423,674 Members | 1,946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,674 IT Pros & Developers. It's quick & easy.

C# / *.NET: Resize Bitmap

100+
P: 115
I have a small program that resizes a bitmap according to mouse location. (see me talking to myself in this forum: http://bytes.com/forum/thread795956.html)

So every time the mouse moves it resizes the bitmap.

Any ideas on what would be the fastest way to resize a bitmap? (Im not looking for quality, just speed)
May 13 '08 #1
Share this Question
Share on Google+
4 Replies


Plater
Expert 5K+
P: 7,872
The Image(or is just Bitmap) object has a like MakeThumbnail function that just takes in a new size and returns a resized version of the image.
May 13 '08 #2

100+
P: 115
Are you refering to "Image.GetThumbnailImage"?

I have just tried this, it did not appear to speed things up. Although, Im starting to think the resize may not be whats causing my slow down.
May 13 '08 #3

Plater
Expert 5K+
P: 7,872
What if, you take a Picturebox control and set the background image property to your image. Then set the (can't think of it's name) property to "Stretch" (as opposed to "center" or etc)
Then change the actual size of the picturebox control with the mouse, maybe that will work faster?
May 14 '08 #4

100+
P: 115
Actually I narrowed down my problem to "Graphics.DrawIcon()" I was thinking the resize was taking up the time, but after changing it up and using "Graphics.DrawImage()" instead it drew a great deal faster.

This came with flicker...double buffer ftw.
May 14 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.