By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

Resize an image... quickly!

P: 24
Hi,

I have an image (Bitmap), which i loaded in my C# application. Now, i want to stretch it horizontally and vertically so that I bring it to the desired size. (note that this might not necessarily be uniform scaling - i.e. the image might need to be stretched more horizontally than vertically, for example).

Is there a *quick* way of doing this in C#?! I imagine it will probably use some unsafe{} code, to speed up manipulation of the image!

So far i am using:
Bitmap bmp = new Bitmap (oldBmp, new Size(...))

thanks for your help!
Apr 20 '07 #1
Share this Question
Share on Google+
1 Reply


RedSon
Expert 5K+
P: 5,000
What you have sounds good. Create a new bitmap from the old one with a different size. Another thing to consider is to have the browser client do if for you by entering in height and width parameters to your final HTML.
Apr 20 '07 #2

Post your reply

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