Click here to Skip to main content
12,621,492 members (36,670 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 20-Feb-13 9:18am
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
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100