How to cut bitmap?

  • Thread starter Thread starter ekey
  • Start date Start date
E

ekey

Hi:
I want to create Bmp by fellow code,and it good work,

Bitmap bitmap1 = new Bitmap((Image)iData.GetData(DataFormats.Bitmap))

but i want to cut the part of the Bmp now . How to do it ?

for example :

Bitmap bitmap2 = new Bitmap(bitmap1,bitmap1.Width,bitmap1.Height - 100);

but now bitmap2 just is bitmap1,only bitmap2's height is scaled.

THS

Ekey
 
EKey,

I'd use the Clone function to achieve what you want.

Rectangle rect = new Rectangle(mImage1.Left, Image1.Top, Image1.Width,
Image1.Height - 100);

Image2 = Image1.Clone(rect,
System.Drawing.Imaging.PixelFormat.Format32bppPArgb);

Hope that helps

rollasoc
 
Hello!

Does any of you know, if Microsoft is planning to implement colormanagement
(ICC profiles) with the Imaging namespace? We're currently depending on
Adobes Graphics Server (a $10k product) and would like to write additional
functionality not necessarily available in the Graphics Server.

Thanks in advance!
 
Back
Top