Solved

Paint  and clean overlay in a picture box.

Posted on 2014-10-20
4
126 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 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