Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
if I have a picture box and a picture in it , and a rectangle , how can I save a piece of that picture that is in the rectangle ?
Posted
Comments
Sergey Alexandrovich Kryukov 20-Feb-13 14:20pm    
Why PictureBox. It's not a picture or a bitmap. Anyway, why asking about it? Now, save where? What did you try?
—SA
mohammadali1375 20-Feb-13 14:27pm    
I write this program : http://uped.uphero.com/img/2915ad0d57ca.png
now I want save the piece picture that is in red rectangle. I have and rect Rectangle rect; and ....
bur I dont know how do it
Sergey Alexandrovich Kryukov 20-Feb-13 14:29pm    
I understand about picture, my concern is PictureBox; most likely, you don't need it.
—SA

You should be using bitmaps. You can copy a rectangle region of a bitmap in this way:
http://msdn.microsoft.com/en-us/library/ms141944.aspx[^].

That's all you need. And you can save new bitmap the way you want.

—SA
 
Share this answer
 
Comments
mohammadali1375 20-Feb-13 14:36pm    
Right. Thank you very much
Sergey Alexandrovich Kryukov 20-Feb-13 14:40pm    
My pleasure.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900