Solved

Paint  and clean overlay in a picture box.

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

15 Experts available now in Live!

Get 1:1 Help Now