-
Rescaling bitmaps
Here's my question. How do you rescale bitmaps?
...and I don't mean using the PaintPicture or StretchBlt API.
e.g. I created a bitmap (used for memory DC) whose size is 320 x 240 pixels. Now how can I rescale (resize, expand...call it whatever you like) it to, for eg., 640 x 480 pixels?
The only solution I've come around so far is to create a new bitmap and delete the old one... but I know there has to be another way.
-
If you want not to lose quality then you can go to
http://vbden.tripod.com/download.htm
Where I have made my own enhancer for gfx...
And I have a DLL version on the go (uses DDraw) that you can use at runtime...
just email me
[email protected]
-
Actually, the bitmap is empty (created with the CreateCompatibleBitmap API).
Hm, just realized I've used the wrong word for the title :)
I need to change the bitmap's width/height. You know, exactly the same as when you change the height/width properties of a PictureBox and the "drawing area" expands...
-
Then why don't you do that?
-
The reason is simple. I can't :(
I tried using the SetBitmapDimensionEx API but the system doesn't use these dimensions when blitting onto a DC. And as for the PixtureBox, I'm trying to use as less controls as possible...
-
Youre so right, you can't, simply because a a bitmap is a bit-map, a singledimensioned array of bits. What you have to do is create a new bitmap and blit over.
-
-
-
I'm creating a program for designing labels, covers, etc.
-
In my DLL I'll have some easy-DX stuff, allowing you do change pixels on a DDraw(DX7) surface using a LONG array of x,y, instead of what DD gives you....