image split in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankaj mishra
    New Member
    • Jun 2007
    • 2

    image split in asp.net

    how we can a split a image in different images
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Hi
    pankaj mishra
    Welcome to TSDN.

    You have reached the right place for knowledge shairing.

    Here you will find a vast resource of related topics and code.

    Feel free to post more doubts/questions in the forum.

    But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.

    It will help Experts in the forum in solving/underestanding your problem in a better way.

    While posting please follow posting guidelines and use proper CODE and other tags to make your post more readable.

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by pankaj mishra
      how we can a split a image in different images
      and again, moved to the .NET forum .

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        While I can't think of a fast way to do it off the top of my head, the Bitmap object (combined with the Graphic object) should contain the methods you need to split up images

        Comment

        • akipng
          New Member
          • Jun 2007
          • 7

          #5
          Hello
          If you want to split image for 2 or even cut out few images from one image to others I would go with this approach.

          Code:
          Bitmap bmpToSplit = ...; // bitmap to be splitted
          Bitmap split1 = new Bitmap(w1,h1,bmpToSplit.PixelFormat); 
          Bitmap split2 = new Bitmap(w2,h2,bmpToSplit.PixelFormat);
          Graphics g1 = Graphics.FromImage(split1 as Image);
          g1.DrawImage(bmpToSplit, new Rectangle(0,0,w1,h1), new Rectangle(xSplit1, ySplit1, w1,h1),GraphicsUnit.Pixel);
          Graphics g2 = Graphics.FromImage(split2 as Image);
          g2.DrawImage(bmpToSplit, new Rectangle(0,0,w2,h2), new Rectangle(xSplit2, ySplit2, w2,h2),GraphicsUnit.Pixel);
          THe Point(xSplit#,y Split#) is coordinate where first image is on original bitmap.
          There is a lot things you can do with images with Graphics class.

          cheers
          AkipNG

          Comment

          Working...