Resizing a bitmap image that works?

W

Wacy

Hi all,

Does anyone know how to resize a bmp image on the compact
Framework? I have spent ages trying and looking for an
answer.

Any help will be appriciated.

I have some code I've been trying to to work:-

Bitmap b1 = new Bitmap("image1.bmp");

Bitmap newImage = new Bitmap(10,10);
Graphics gr = Graphics.FromImage(newImage);

Rectangle newImageSize = new Rectangle(0, 0, 10, 10);
Rectangle oldImageSize = new Rectangle(0, 0, b1.Width,
b1.Height);

gr.DrawImage(b1, imageToDraw, oldImageSize,
GraphicsUnit.Pixel);

pictureBox1.Image = b1;
pictureBox1.Update();

Wacy
 
R

Romu

More example about images:
go to the www.codeppc.com/dotnet french web site and
search "Pex" which is a Picture Explorer I have written
for the .Net CF.

The sources are provided, you'll find some examples about
images processing.

Romu
 
W

Wacy

Thanks V. Much Romu,

Followed your advice and with a little tinkering got it
to work.

Cheers

Wacy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Scrolling bitmap problem 1
C# Image Array in Exception 3
Out of Memory Error w/Image from HBitmap 4
Large Image 1
large image 4
splitting image 2
Image not Displaying 2
Setting background image on run time. 7

Top