471,089 Members | 1,116 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

image split in asp.net

how we can a split a image in different images
Jun 7 '07 #1
4 2507
debasisdas
8,127 Expert 4TB
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.
Jun 7 '07 #2
r035198x
13,262 8TB
how we can a split a image in different images
and again, moved to the .NET forum .
Jun 7 '07 #3
Plater
7,872 Expert 4TB
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
Jun 7 '07 #4
akipng
7
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.

Expand|Select|Wrap|Line Numbers
  1. Bitmap bmpToSplit = ...; // bitmap to be splitted
  2. Bitmap split1 = new Bitmap(w1,h1,bmpToSplit.PixelFormat); 
  3. Bitmap split2 = new Bitmap(w2,h2,bmpToSplit.PixelFormat);
  4. Graphics g1 = Graphics.FromImage(split1 as Image);
  5. g1.DrawImage(bmpToSplit, new Rectangle(0,0,w1,h1), new Rectangle(xSplit1, ySplit1, w1,h1),GraphicsUnit.Pixel);
  6. Graphics g2 = Graphics.FromImage(split2 as Image);
  7. g2.DrawImage(bmpToSplit, new Rectangle(0,0,w2,h2), new Rectangle(xSplit2, ySplit2, w2,h2),GraphicsUnit.Pixel);
  8.  
THe Point(xSplit#,ySplit#) is coordinate where first image is on original bitmap.
There is a lot things you can do with images with Graphics class.

cheers
AkipNG
Jun 7 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by William Starr Moake | last post: by
1 post views Thread by Manish Songar via .NET 247 | last post: by
2 posts views Thread by dineshbajaj | last post: by
1 post views Thread by Dan | last post: by
6 posts views Thread by sarika | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.