fltk.images.tiled

FLTK Tiled Image Class

This module provides the TiledImage class that wraps FLTK's Fl_Tiled_Image. Tiled images repeat a source image to fill an area, useful for backgrounds and patterns.

The TiledImage class provides:

  • RAII-based resource management
  • Construction from any existing Image
  • Automatic tiling to fill specified dimensions

    Authors

    Dejan Lekić

    License

    BSD-3-Clause

Types 1

Tiled/repeated background image.

TiledImage takes a source image and repeats it to fill an area of specified dimensions. This is useful for creating tiled backgrounds or patterns from a single small image.

Note

The source image must remain valid for the lifetime of the

TiledImage, as the tiled image references (does not copy) it.

Example:

// Create a tiled background from a small pattern
auto pattern = new PngImage("pattern.png");
auto background = new TiledImage(pattern, 800, 600);
// Use background as widget image...

Fields
FltkTiledImage _tiledHandle
Image _sourceImageReference to source image to prevent GC collection
Methods
FltkTiledImage tiledHandle() @safe nothrow @nogcReturns the underlying tiled image handle.
Image sourceImage() @safe nothrow @nogcReturns the source image used for tiling.
bool isValid() const @safe nothrow @nogcChecks if the tiled image was created successfully.
Constructors
this(Image source, int width = 0, int height = 0)Creates a tiled image from a source image.
Destructors
~thisDestroys the tiled image.