me again
i've seen some code samples where there was resource files ine the evC project. an icon, a .bmp ...
* if i do add a .bmp resource in the project, what would be the way to retrieve a pointer to it for drawing or any...
* this could look very simple for u all but how can i assign a .ico int the project's resources to the compiled .exe ??? didn't find yet
thx again ...
Lewil
You can use LoadBitmap or LoadImage to retrieve a handle to the bitmap that is in your app's resources. You can then use that handle directly with a Device Context. If you are blitting manually (using EasyCE, etc), then you will want to gain direct access to the bitmap's bits. That can be a bit tricky. What I have done in the past is to create a new bitmap (CreateCompatibleBitmap) of the correct size, select it into a temporary Device Context (CreateCompatibleDC), then blit the resource bitmap into my temporary DC. The bitmap you created will then be a copy of the resouce bitmap, and you will have direct access to its bits (use GetObject to fill a BITMAP struct with info on the Bitmap handle). I could not find a way to directly access the bits of a bitmap handle that referred to a resource. You will also have to take into account if the bitmap is palettized or what RGB encoding it uses, and convert it to RGB565 or whatever you (and EasyCE) uses for its surfaces.
If you are embedding a palettized bitmap as a resource, make sure you save the palette to a file using your Paint Program, then import that palette into your bitmap in eVC++ after you have inserted the bitmap.
eVC++ should have created a generic icon for your application when you created the project. If not, then just insert a new icon (and create both 16x16 and 32x32 sizes for it). Then edit the resource.h file to make sure the new icon's value is 101.
Dan East