Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How would I get a bitmap from a pointer to a bitmap?
Message
General information
Forum:
Visual Basic
Category:
Windows API functions
Miscellaneous
Thread ID:
00198491
Message ID:
00198617
Views:
14
>Below is the definition of an API function that I am calling from VB. I do not quite know how to handle parameter *p_image. This parameter is a pointer to a bitmap.
>How would I derefernce that pointer to get the bitmap?
>
>Using VB Control Creation Edition I am making an OCX wrapper for API calls that will be called from a Visual FoxPro application. What I would like to do is send a path to the bitmap back to my application and let it display the bitmap. If that is not possible then I can have Visual Basic display the bitmap.
>

The HBITMAP is a handle to a bitmap, a memory-resident structure that contains no file information, but instead actually describes the layout and data values for a loaded image.

You'd use the GetDIBits() API call to retrieve the actual bitmap into a buffer.

>Thanks for any help.
>
>Steve Smith
>
>==================================================
>long __stdcall SWAPI_LI_GetLabelPreview(
> const char *p_LabelPath,
> char *p_LabelDesc,
> unsigned long *p_LabelDescMaxLen,
> HBITMAP *p_Image);
>
>PARAMETERS:
>p_LabelPath - The path and file name for the label.
>p_LabelDesc - A pointer to a string which is used to obtain the description for the label.
>p_LabelDescMaxLen - A pointer to an unsigned long used to get or supply the maximum length for the p_LabelDesc field. If p_LabelDesc is NULL, p_LabelDescMaxLen will be set to the length of the value (including the NULL terminator) which would have been copied into p_LabelDesc had it not been NULL. Otherwise it will copy only this number of characters. If it is NULL it will not use this value and the number of characters copied to p_LabelDesc will not be limited.
>
>p_Image - This is a pointer to a bitmap which is a picture of the label design.
>
>RETURN VALUES:
>Returns S_OK on success. Otherwise it returns one of the following:
>SWERR_NOTINITIALIZED - SWAPI_LP_Initialize was not called or successful
>ERROR_OUTOFMEMORY - Memory allocation failed
>SWERR_QDFNOTLOADED - Unable to load the label design.
>
>COMMENTS:
>This function gets the label description and a picture of the label.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform