AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

GetDIBits

The GetDIBits function retrieves the bits of the specified bitmap and copies them into a buffer using the specified format.

VB4-32,5,6
Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As BITMAPINFO, ByVal wUsage As Long) As Long

VB.NET
System.Drawing.Bitmap.LockBits

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Gdi32

Parameter Information
hdc
Identifies the device context.

hbmp
Identifies the bitmap.

uStartScan
Specifies the first scan line to retrieve.

cScanLines
Specifies the number of scan lines to retrieve.

lpvBits
Points to a buffer to receive the bitmap data. If this parameter is NULL, the function passes the dimensions and format of the bitmap to the BITMAPINFO structure pointed to by the lpbi parameter.

lpbi
Points to a BITMAPINFO structure that specifies the desired format for the device-independent bitmap (DIB) data.

uUsage
Specifies the format of the bmiColors member of the BITMAPINFO structure. It must be one of the following values:
DIB_PAL_COLORS
The color table should consist of an array of 16-bit indices into the current logical palette.
DIB_RGB_COLORS
The color table should consist of literal red, green, blue (RGB) values.

Return Values
If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap.

Windows 95:

If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is the total number of scan lines in the bitmap.

Windows NT:

If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is non-zero.

If the function fails, the return value is zero.

Examples
- DIB

Related Functions

No VB.NET Example Found

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/