'Load the original bitmap.
dim bm as bitmap=Bitmap.FromFile("filename....")
'create a bigger one
dim bigbm as new Bitmap(bm.Width*2, bm.Height*2)
'get a graphics for the copy so you can draw on it.
dim g as Graphics=Graphics.FromImage(bigbm)
'draw the original to the graphics.
g.DrawImage(bm,new Rectangle(0,0,bigbm.Width,
bigbm.Height),0,0,bm.Width,bm.Height,GraphicsUnit. Pixel)
'dispose of the graphics.
g.Dispose()
'and the original
bm.Dispose() 'this closes the file.
'now save the bigger image...
bigbm.Save("filename...",ImageFormat.Bmp)
--
Bob Powell [MVP]
C#, System.Drawing
The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
Read my Blog at
http://bobpowelldotnet.blogspot.com
" active" <ac****@REMOVEa-znet.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
How can I increase the size of a bitmap while preserving the image in it.
I tried (among many other things) :
b1 = New Drawing.Bitmap(b1, picData.Width, picData.Height)
and it doesn't seem to work.
I've searched the net and can find nobody that does it.
Is this a difficult thing to do? I can't seem to find the combination that
works.
Thanks for any help,
Cal