image split in asp.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • akipng
    replied
    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

    Leave a comment:


  • Plater
    replied
    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

    Leave a comment:


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

    Leave a comment:


  • debasisdas
    replied
    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.

    Leave a comment:


  • pankaj mishra
    started a topic image split in asp.net

    image split in asp.net

    how we can a split a image in different images
Working...