See Also Examples Applies To
Creates a new GdPicture Image from raw bitmap in memory.
Syntax
object.CreateImageFromRawBits (nWidth, nHeight, nStride, nPixelFormat, nBits)
The CreateImageFromRawBits syntax has these parts:
| Part | Description |
| object | Required. An object expression that evaluates to an object in the Applies To list. |
| nWidth | Required. Long. Specifies the width, in pixels, of the bitmap. |
| nHeight | Required. Long. Specifies the height, in pixels, of the bitmap. |
| nStride | Required. Long. Specifies the byte offset between the beginning of one scan line and the next. This is usually (but not necessarily) the number of bytes in the pixel format (for example, 2 for 16 bits per pixel) multiplied by the width of the bitmap. The value passed to this parameter must be a multiple of four. |
| nPixelFormat |
Required. Long. specifies the pixel format of the bitmap. Can be: PixelFormat1bppIndexed = 196865 PixelFormat4bppIndexed = 197634 PixelFormat8bppIndexed = 198659 PixelFormat16bppGrayScale = 1052676 PixelFormat16bppRGB555 = 135173 PixelFormat16bppRGB565 = 135174 PixelFormat16bppARGB1555 = 397319 PixelFormat24bppRGB = 137224 PixelFormat32bppRGB = 139273 PixelFormat32bppARGB = 2498570 PixelFormat32bppPARGB = 925707 PixelFormat48bppRGB = 1060876 PixelFormat64bppARGB = 3424269 PixelFormat64bppPARGB = 1851406 |
| nBits | Required. Long. Pointer to an array of bytes that contains the pixel data. The caller is responsible for allocating and freeing the block of memory pointed to by this parameter. |
Returns
Long.
0: The image could not created. Use the GetStat() function to determine the
reason this function failed.
Non-zero: GdPicture Image handle. Handle of the created image.
Remarks
If success, set the created image as the native GdPicture image.
Warning: Do not remove the raw bitmap from the memory until you delete the created GdPicture Image.
Category
Load, Import & Create an image