Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
..msdn    Add comment     W32 Constants      Translate this page
Creates a DIB that applications can write to directly.
Code examples:
HBITMAP CreateDIBSection(
  __in   HDC hdc,
  __in   const BITMAPINFO *pbmi,
  __in   UINT iUsage,
  __out  VOID **ppvBits,
  __in   HANDLE hSection,
  __in   DWORD dwOffset
FoxPro declaration:
DECLARE INTEGER CreateDIBSection IN gdi32;
    INTEGER hdc,;
    STRING @pbmi,;
    LONG iUsage,;
    INTEGER @ppvBits,;
    INTEGER hSection,;
    LONG dwOffset
hdc [in]
A handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context"s logical palette to initialize the DIB colors.

pbmi [in]
A pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.

iUsage [in]
The type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values).

ppvBits [out]
A pointer to a variable that receives a pointer to the location of the DIB bit values.

hSection [in]
A handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.

dwOffset [in]
The offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin. This value is ignored if hSection is NULL.
Return value:
If the function succeeds, the return value is a handle to the newly created DIB, and *ppvBits points to the bitmap bit values.

If the function fails, the return value is NULL, and *ppvBits is NULL.

        num2dword(nBitmapWidth) + num2dword(nBitmapHeight) +;
        num2word(1) + num2word(nBitsPerPixel) +;


hBitmap=CreateDIBSection(hDC, @cBITMAPINFOHEADER,;
    DIB_RGB_COLORS, @ppvBits, 0, 0)
My comment:
If hSection is NULL, the system allocates memory for the DIB. The system closes the handle to that memory when you later delete the DIB by calling the DeleteObject function.
Word Index links for the CreateDIBSection :
Translate this page:
  Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
Created: 2009-11-06 17:36:18
Modified: 2009-11-06 17:41:17
Visited in last 7 days: 80
User Contributed Notes:
There are no notes on this subject.

Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
12 sec.Function: 'InternetAttemptConnect'
23 sec.Example: 'Obtaining names of local and global groups for current user (WinNT/XP/2K)'
34 sec.Function: 'waveOutWrite'
Function group: 'Windows Multimedia'
46 sec.Function: 'mmioAscend'
Function group: 'Windows Multimedia'
59 sec.Function: 'StretchDIBits'
Function group: 'Bitmap'
1.15 min.
1.58 min.Function: 'SQLInstallerError'
Function group: 'ODBC API'
1.75 min.Function: '_lopen'
Function group: 'File Management'
1.93 min.Function: 'EnumPrintProcessorDatatypes'
Function group: 'Printing and Print Spooler'
2.13 min.Function: 'listen'
Function group: 'Windows Sockets 2 (Winsock)'
Advertise here!