Loading and Saving a bitmap

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: tom (t_at_inwind.it)
Date: 04/01/04


Date: Thu, 01 Apr 2004 21:48:03 GMT

Hallo,

I have a problem.

I'm using VB5.

I need to load a wonderful 16 Million color .bmp from a file,
increase its width (let's say 50 pixel on the right),
then save it into another .bmp file
(I don't need to display the initial image
and I don't need to display the final image).
All this,
under the 256 video colors resolution.

If I perform this by using the "PictureBox" control
and the common "Loadfile" and "SaveFile" commands,
the file I get loses its initial wonderful 16 Million colors
(it has only the 256 colors of the video resolution).

---
I think I need to use a Device Indipendent Bitmap
and use API like LoadBitmap, CreateCompatibleBitmap...
Not a easy task.
Are there example on how to load image from a file,
and then save into another file (without loosing 
the initial image color depth)?
tom


Relevant Pages