Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 1.94 KB

CreateCompatibleBitmap.md

File metadata and controls

65 lines (47 loc) · 1.94 KB

Home

Function name : CreateCompatibleBitmap

Group: Bitmap - Library: gdi32


Creates a bitmap compatible with the device that is associated with the specified device context.


Code examples:

Placing an arbitrary rectangular area of main VFP window on the Clipboard
How to copy the image of a form to the Clipboard using Bitmap API functions
How to print FoxPro form
Storing screen shot of a form to bitmap file
How to put a horizontal text scrolling on the form (a news line, marquee)
How to put a vertical text scrolling on the form (a movie cast)
Subclassing CommandButton control to create BackColor property
Vertical Label control
How to make a VFP form fading out when released (GDI version)

Declaration:

HBITMAP CreateCompatibleBitmap(
  HDC hdc,        // handle to DC
  int nWidth,     // width of bitmap, in pixels
  int nHeight     // height of bitmap, in pixels
);  

FoxPro declaration:

DECLARE INTEGER CreateCompatibleBitmap IN gdi32;
	INTEGER hdc,;
	INTEGER nWidth,;
	INTEGER nHeight  

Parameters:

hdc [in] Handle to a device context.

nWidth [in] Specifies the bitmap width, in pixels.

nHeight [in] Specifies the bitmap height, in pixels.


Return value:

If the function succeeds, the return value is a handle to the bitmap.


Comments:

When created the bitmap can be placed on a device context using SelectObject function. When you no longer need the bitmap, call the DeleteObject function to delete it.