Class | Fox::FXBitmap |
In: |
rdoc-sources/FXBitmap.rb
|
Parent: | FXDrawable |
A bitmap is a rectangular array of pixels. It supports two representations of these pixels: a client-side pixel buffer, and a server-side pixmap which is stored in an organization directly compatible with the screen, for fast drawing onto the device. The server-side representation is not directly accessible from the current process at it lives in the process of the X server or GDI (on Microsoft Windows). The client-side pixel array is of size height x (width+7)/8 bytes; in other words, 8 pixels packed into a single byte, starting with bit zero on the left.
BITMAP_KEEP: | Keep pixel data in client |
BITMAP_OWNED: | Pixel data is owned by image |
BITMAP_SHMI: | Using shared memory image |
BITMAP_SHMP: | Using shared memory pixmap |
getData | -> | data |
Return an initialized FXBitmap instance. If a client-side pixel buffer (the pixels argument) has been specified, the bitmap does not own that pixel buffer unless the BITMAP_OWNED flag is set. If the BITMAP_OWNED flag is set, but a nil value for pixels is passed in, a pixel buffer will be automatically created and will be owned by the bitmap. The flags BITMAP_SHMI and BITMAP_SHMP may be specified for large bitmaps to instruct FXBitmap#render to use shared memory to communicate with the server.
Release the client-side pixels buffer and free it if it was owned. If it is not owned, the image just forgets about the buffer.
Resize both client-side and server-side representations (if any) to the given width and height. The new representations typically contain garbage after this operation and need to be re-filled.
Rescale pixels image to the specified width and height; this calls resize to adjust the client and server side representations.
Populate the bitmap with new pixel data of a new size; it will assume ownership of the pixel data if the BITMAP_OWNED option is passed in the opts. The size of the server- side representation of the image, if it exists, is adjusted but the contents are not updated; to update the server-side representation, call render.