Click to See Complete Forum and Search --> : Rescaling bitmaps
Arcom
Jun 11th, 2001, 03:47 PM
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.
Sastraxi
Jun 11th, 2001, 03:57 PM
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
vb.den@gmx.co.uk
Arcom
Jun 11th, 2001, 04:13 PM
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...
Sastraxi
Jun 11th, 2001, 04:18 PM
Then why don't you do that?
Arcom
Jun 11th, 2001, 04:31 PM
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...
kedaman
Jun 11th, 2001, 04:39 PM
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.
Arcom
Jun 11th, 2001, 04:47 PM
I thought so...bummer...
Sastraxi
Jun 11th, 2001, 05:02 PM
Whacha doin'?
Arcom
Jun 14th, 2001, 03:49 PM
I'm creating a program for designing labels, covers, etc.
Sastraxi
Jun 14th, 2001, 03:56 PM
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....
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.