Highlight part of image

obrien.james

Member
Joined
Sep 11, 2009
Messages
15
Programming Experience
Beginner
Hi,

Im not sure if this is the right place to post this question, but here it goes:

What i am trying to do is open a tiff file and then be able to highlight different areas using my mouse. The way i would want to do this is to use my mouse to draw around the section of the document that I want to highlight and it adds a simi-transparent box.

I think I need to make a new graphics layer on top of the current image, and then draw on that, is this correct?

I am fairly new to Vb.net and would appreciate any guidance that anyone can offer.

Many thanks

james
 
Ok, not that easy thing to begin with vb.net.

First, I would create a class, inherited from UserControl or something like that.
In this class, i would override the "onPaint" or "onPaintBackground" to draw the highlight effect.
For this you only need to fill the hole cliprect with the desired color like

e.graphics.clear(color.fromRGB(128,255,255,255)) 'Halftransparent White

In my Displaying Form I now would create a instance of this Class and only change the Position and Size for it with the "MouseDown", "MouseUp" and "MouseHover" Events.
 
Thanks for the reply,

Will this be anchored to the image, so that when I scroll up and down the highlight will move with it?
And do I need to make a new layer on top of the image so that I can draw on it? If so how do I go about that?

Thanks

James
 
Back
Top