You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Creating, Loading & Closing GdPicture Image > CreateGdPictureImageFromRawBits Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.CreateGdPictureImageFromRawBits Method

Creates a new GdPicture Image from raw bitmap in memory.

C#
public int CreateGdPictureImageFromRawBits(
    int Width, 
    int Height, 
    int Stride, 
    PixelFormat PixelFormat, 
    IntPtr Bits
);
Visual Basic
Public Function CreateGdPictureImageFromRawBits(
    ByVal Width As Integer, 
    ByVal Height As Integer, 
    ByVal Stride As Integer, 
    ByVal PixelFormat As PixelFormat, 
    ByVal Bits As IntPtr
) As Integer
Parameters
Parameters 
Description 
Width 
Specifies the width, in pixels, of the bitmap.  
Height 
Specifies the height, in pixels, of the bitmap.  
Stride 
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.  
PixelFormat 
specifies the pixel format of the bitmap. A member of the PixelFormat enumeration.  
Bits 
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

0: The image could not created. Use the GetStat() function to determine the reason this function failed. 

Non-zero: GdPicture Image Identifier. The created image.

If success, set the created image as a GdPicture image. 

Warning: Do not remove the raw bitmap from the memory until you delete the created GdPicture Image.

What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.