Struct Bitmap

struct Bitmap

Constructors

NameDescription
this (width, height, format)
this (data)

Properties

TypeNameDescription
format[get] Bitmap pixel format. PixelFormat.invalid on empty bitmap
bool
hasNinePatch[get] Check whether there is nine-patch information available
int
height[get] Bitmap height, in pixels
uint
id[get] Unique ID of bitmap instance, for using with hardware accelerated rendering for caching
const(NinePatch)*
ninePatch[get, set] Nine-patch info pointer, null if this is not a nine patch image buffer
ulong
rowBytes[get] Length of one bitmap row in bytes
SizeOf!(int)
size[get] Bitmap size, in pixels
int
width[get] Bitmap width, in pixels

Methods

NameDescription
applyClipping (rc) Apply buffer bounds clipping to rectangle
applyClipping (rc, rc2) Apply buffer bounds clipping to rectangle. If clipping applied to first rectangle, reduce second rectangle bounds proportionally
blit (source, srcRect, dstRect) Copy pixel data from srcRect region of source bitmap to dstRect of this bitmap.
detectNinePatch () Detect nine patch using image 1-pixel border. Returns true if 9-patch markup is found in the image
fill (color) Fill the whole bitmap with a solid color
fillRect (rect, color) Fill a rectangle with a solid color. The rectangle is clipped against image boundaries
invalidate () Call to remove this image from OpenGL cache when image is updated
look () Provides a constant view on the pixel data. The bitmap must have non-zero size
mutate () Provides a mutable access to the pixel data. The bitmap must have non-zero size
opCast ()
pixels () Get a constant pointer to the beginning of the pixel data. null if bitmap has zero size
preMultiplyAlpha ()
resize (width, height) Resize the bitmap, invalidating its content