Question Resize a Bitmap Type

papa_k

Member
Joined
Jun 1, 2009
Messages
22
Programming Experience
1-3
Using this forum, i was able to interigate a file and then alter a mouse cursor to become a bitmap based on the file information.

As part of the bitmap type, is it possible to resize the bitmap to ensure that they are always exactly the same.

Currently, the application will get the bitmap, but if its original is 640x480 it presents it in that size - if its 1024x768 it presents it in that size.

The "user experience" is pretty rubbish.

Can (like using the picture frame on the forms) you allow the image to be a specific size so that the image when drag and dropped is always the same size for the user and doesnt get LARGE and small depending on thier original image size?

Thanks,
 
Hi papa_k, here's an easy way to shrink a bitmap (bmp) to whatever size you like (width * height pixels):
VB.NET:
Dim img As Image = bmp.GetThumbnailImage([I]width[/I], [I]height[/I], Nothing, Nothing)
bmp = CType(img, Bitmap)

all the best, Vic
 
Last edited:
MattP - the link works, but when the code was compiled it failed to work... :confused:

Vic - thanks, i will try this and post a reply.

Cheers,

Papa
 
MattP - the link works, but when the code was compiled it failed to work... :confused:

I just ran it using Visual Studio 2005 and it worked fine.

Even if it fails to open in Visual Studio for you should be able to open the files ResizeLockbits.vb and ResizeSetPixel.vb in a text editor to see what's being done.
 
Back
Top