Click here to Skip to main content
11,415,000 members (66,084 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#
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
Sergey Alexandrovich Kryukov at 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?
mohammadali1375 at 20-Feb-13 14:27pm
I write this program :
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 at 20-Feb-13 14:29pm
I understand about picture, my concern is PictureBox; most likely, you don't need it.
Rate this: bad
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:[^].

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

mohammadali1375 at 20-Feb-13 14:36pm
Right. Thank you very much
Sergey Alexandrovich Kryukov at 20-Feb-13 14:40pm
My pleasure.
Good luck, call again.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,160
1 OriginalGriff 7,487
2 Maciej Los 3,710
3 Abhinav S 3,298
4 Peter Leow 3,084

Advertise | Privacy | Mobile
Web04 | 2.8.150427.4 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2015
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