How to cut bitmap?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ekey

    #1

    How to cut bitmap?

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

    Bitmap bitmap1 = new Bitmap((Image)i Data.GetData(Da taFormats.Bitma p))

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

    for example :

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

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

    THS

    Ekey


  • rollasoc

    #2
    Re: How to cut bitmap?

    EKey,

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

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

    Image2 = Image1.Clone(re ct,
    System.Drawing. Imaging.PixelFo rmat.Format32bp pPArgb);

    Hope that helps

    rollasoc

    "ekey" <ekey11@hotmail .com> wrote in message
    news:#5DC$7SZDH A.2352@TK2MSFTN GP12.phx.gbl...
    [color=blue]
    > Hi:
    > I want to create Bmp by fellow code,and it good work,
    >
    > Bitmap bitmap1 = new Bitmap((Image)i Data.GetData(Da taFormats.Bitma p))
    >
    > but i want to cut the part of the Bmp now . How to do it ?
    >
    > for example :
    >
    > Bitmap bitmap2 = new Bitmap(bitmap1, bitmap1.Width,b itmap1.Height - 100);
    >
    > but now bitmap2 just is bitmap1,only bitmap2's height is scaled.
    >
    > THS
    >
    > Ekey
    >
    >[/color]


    Comment

    • Anders Borum

      #3
      Re: How to cut bitmap?

      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!

      --
      venlig hilsen / with regards
      anders borum
      --


      Comment

      Working...