Using Win32 functions in Visual FoxPro Image Gallery
Bitmap
..msdn
AlphaBlend
BitBlt
CreateCompatibleBitmap
CreateDIBSection
GetDIBits
GradientFill
LoadBitmap
StretchBlt
StretchDIBits
Code examples:
CreateDIBSection
..msdn    Add comment     W32 Constants      Translate this page
Creates a DIB that applications can write to directly.
Code examples:
Declaration:
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
Parameters:
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.
Usage:
nBitmapWidth=500
nBitmapHeight=300
nBitsPerPixel=24
ppvBits=0

cBITMAPINFOHEADER=num2dword(BHDR_STRUCT_SIZE) +;
        num2dword(nBitmapWidth) + num2dword(nBitmapHeight) +;
        num2word(1) + num2word(nBitsPerPixel) +;
        num2dword(BI_RGB)

cBITMAPINFOHEADER=PADR(cBITMAPINFOHEADER,;
    BHDR_STRUCT_SIZE, CHR(20))

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  
FreeTranslation.com 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: 73
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.166.199.178)
19 sec.Function: 'GdipDeleteStringFormat'
37 sec.Function: 'socket'
59 sec.Function: 'DeleteFile'
1.82 min.Function: 'GetLocalTime'
4.1 min.Function: 'BringWindowToTop'
1 day(s)Function: 'JetBeginTransaction'
 Function: 'PathIsRoot'
 Function: 'GdipIsStyleAvailable'
 Function: 'AVIFileOpen'
 Function: 'waveOutOpen'
Google
Advertise here!