English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

please Show how i can catch events for a bitmap image without MFC.
ONLY win32 api
ONLY c++

Thanks

2006-07-01 19:27:16 · 1 answers · asked by Anonymous in Computers & Internet Programming & Design

1 answers

What do you mean catch events with Bitmaps? First of all whenever you need to catch events, you would need the pointer of the location you wish to cause that event.

So you would need the pointer to that bitmap (I don't know if any event would help here)

But if you wish to find the pointer of the Bitmap you could use this function.
// Loads A Bitmap Image
AUX_RGBImageRec *LoadBMP(char *Filename) {
// File Handle
FILE *File=NULL;
// Make Sure A Filename Was Given
if (!Filename)
{
// If Not Return NULL
return NULL;
}
// Check To See If The File Exists
File=fopen(Filename,"r");
if (File) // Does The File Exist?
{
// Close The Handle
fclose(File);
// Load The Bitmap And Return A Pointer
return auxDIBImageLoad(Filename);
}
// If Load Failed Return NULL
return NULL;
}

The above function will return a pointer to that image using the normal C++ library... What you would do later is if the image is loaded or whatever you choose from you just pass that pointer to your application. You would need to create callbacks to handle the function pointers that will accept that pointer.

2006-07-02 09:35:00 · answer #1 · answered by ? 6 · 1 0

fedest.com, questions and answers