Stretch Bitmap

  • Thread starter Thread starter pavel.orehov
  • Start date Start date
P

pavel.orehov

Hi,

Does anybody knows how to stretch Bitmap in C#.

Bitmap b = Bitmap.FromFile("...");

// stretch code ???


Thanks,
Pavel
 
This do?

static void Main() {
using (Image source = Bitmap.FromFile(@"C:\WINDOWS\Soap
Bubbles.bmp"))
using(Image dest = new Bitmap(source, (int) (source.Width * 1.5),
(int) (source.Height * 1.5))) {
dest.Save(@"c:\new.bmp");
}
}
 
Marc said:
This do?

static void Main() {
using (Image source = Bitmap.FromFile(@"C:\WINDOWS\Soap
Bubbles.bmp"))
using(Image dest = new Bitmap(source, (int) (source.Width * 1.5),
(int) (source.Height * 1.5))) {
dest.Save(@"c:\new.bmp");
}
}

Thanks a lot, it works fine.
 

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

Back
Top