Solved

Paint  and clean overlay in a picture box.

Posted on 2014-10-20
4
122 Views
Last Modified: 2015-06-09
Hello.
On a form I have:

A picture box with a drawing with position texts.
I also have a ListView with objects telling the location of the
texts in the picture.
For example;
MyObject.Text
MyObject.XLeft
MyObject.XRight
MyObject.YTop
MyObject.YBottom

When I select an item in the listview, I want to (based on the object)
draw a rectangle  around the Text in the picture.
(IE based  based on XLeft,XRight,YTop and YBottom  values.)
When I select another item, I want  to draw a box around that
text in the picture (and clear the old rectangle)

Can someone help me out with that?
0
Comment
Question by:pucko73
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Glen Richmond
ID: 40391479
Think you may need some form of OCR ocx to detect the Text on the image, as it not realy text but part of the Image.
0
 

Author Comment

by:pucko73
ID: 40391492
I know the location of the text.

It's in MyObject  (both the coordinates and the text it self)
0
 
LVL 2

Assisted Solution

by:Glen Richmond
Glen Richmond earned 250 total points
ID: 40391617
0
 
LVL 22

Accepted Solution

by:
Snarf0001 earned 250 total points
ID: 40391841
You should probably handle the Paint event on the picturebox, and inside check for the cords of the selected listview item (if any is selected), and call e.Graphics.DrawRectangle(...) accordingly.

Note that you may also have to call Invalidate() on the picturebox control when the selecteditem of the listview changes, so it can trigger the GUI update.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now