Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi every one i have my own project in it Picture Box and Button My question i want to press on the button and scanner work and crop my own image and add it to picture box
i search on internet and found this URL .NET TWAIN image scanner[^]

this scanner worked with me but Problem when it scanned image it viewed in full page i want to control in this image to crop a part from it and view this part in Picture Box
Posted
Updated 17-Jan-15 22:58pm
v3
Comments
Sergey Alexandrovich Kryukov 18-Jan-15 8:24am    
First of all, forget PictureBox, if you want to manipulate the image in this or another way. It's possible, but not helpful. Use Image, not PictureBox.
Now, doing what you need is just some work to be done, it does not require some expert advice.
If you show what have you tried so far, explain the particular problem you are facing, we will gladly help you.

It looks like your questions are circulating about finding some existing code and using it. I don't see where you are trying to write anything. This would be off-topic for this forum unless you do.

—SA
LLLLGGGG 18-Jan-15 9:35am    
He might not know how to go further with his project because he does not have the required knowledge...

Anyway he hasn't said which technology he's using... If he's using Windows Forms, I think PictureBox is the only way to display the image. If he's using WPF then Image is the control to be chosen.

LG
Sergey Alexandrovich Kryukov 18-Jan-15 14:29pm    
Your statement about PictureBox is totally wrong. "Only way"? Rather, it is not a reasonable way at all, considering the fact the graphics should be modified (by showing those cropping lines OP really needs). PictureBox absolutely redundant and can only complicate things. Apparently, you have no clue how to reasonably render graphics in Forms, which would be fine. You can ask your questions, do your study, and so on. But it's really bad to try to confuse the beginners. They are already well confused by the fact this control is just there, so many beginners try to misuse it.
—SA
LLLLGGGG 19-Jan-15 7:42am    
I looked at one of my old projects and... it seems you're right: I've used a Panel to display the image.

I'm sorry for my mistake, anyway, my aim was not to confuse the beginners.

LG
Sergey Alexandrovich Kryukov 19-Jan-15 14:04pm    
Great. Panel could do, or many other things, basically, it could be any control derived from System.Windows.Forms.Control, a custom control.
No problem; I really appreciate your note.

Cheers,
—SA

Hi,

If you are working with Windows Forms, you can use GDI+ to crop images.
http://msdn.microsoft.com/en-us/library/e06tc8a5%28v=vs.110%29.aspx[^]

This is the search page of codeproject for query GDI+ with tags C# and beginner...

http://www.codeproject.com/search.aspx?q=gdi%2b+tag%3a%28c%23+and+Beginner%29&doctypeid=1%3b2%3b3%3b13%3b14[^]

and an article to start (Unfortunately, this is in C++)
Starting with GDI+[^]

Hope this helps...
LG
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 18-Jan-15 14:34pm    
Please see my comments to the question, on PictureBox. Even your own links clearly show that it should not be used. Should I understand it the way you don't understand what you reference by yourself? Please understand, I'm not trying to bug you with that. After all, it would be fine, you can give an advice without full understanding, you can always get to it later. I just want to advise: if you get into some arguments, learn the topic better.
—SA
 
Share this answer
 
Comments
BillWoodruff 18-Jan-15 5:00am    
Please add this to your original post rather than post this as a solution.

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