|
-
Feb 15th, 2011, 03:07 PM
#1
Thread Starter
Junior Member
Transparent drawing layer
Okay, I'm making a fresh start and re-exploring my options.
I'm trying to put a layer of transparency over a program that will act as a drawing layer.
The cursor should be able to sniff to see whether it's sitting on transparency, or a drawn object. Transparency it will click through, while clicking on a drawn object will enable the user to edit said drawn object.
I've been trying to do this using a user control I made from scratch, but this is starting to look more and more like a dead end the deeper I get into it. Currently the layer of transparency works, along with the cursor sniffing, but the user control refuses to be brought to the front.
Any ideas on other ways to go about this / ways to make the user control work?
-
Feb 15th, 2011, 03:51 PM
#2
Re: Transparent drawing layer
Without knowing more details about what you are trying to achieve I wouldn't be of much help, but I get the strong feeling that you should explore the functionality of System.Drawing.Region class. It can hold complex shapes and check if any given point is inside it or not.
-
Feb 15th, 2011, 04:06 PM
#3
Thread Starter
Junior Member
Re: Transparent drawing layer
If you look at any of the other posts I've made, I talk about it in much more detail. All of the actual drawing tools and such are made. The primary issue I'm having is making my transparent drawing layer come to the front. (Me.Bringtofront did nothing for me)
-
Feb 15th, 2011, 06:45 PM
#4
Re: Transparent drawing layer
This may or may not be of use to you but you may like to follow the CodeBank link in my signature and check out my thread on Manipulating GDI+ Drawings.
-
Feb 18th, 2011, 03:36 PM
#5
Thread Starter
Junior Member
Re: Transparent drawing layer
I'm looking into what you suggested now, Edge. I really have no experience with either of those things but I'll be getting help from my boss / professor over the next few days with it.
-
Feb 18th, 2011, 04:35 PM
#6
Re: Transparent drawing layer
I think your best option is WPF. The transparency, clicking through it and such, that sounds like exactly what WPF has built in. In WPF a mouse click events travels throug the various layers of elements (once in the back to front direction as a preview event, and once in the front to back direction (or the other way around, but I think this is right)), unlike in winforms where only the actual clicked element receives the event. For example, in WPF if you have a button in a panel in a listboxitem in a listbox in a window, then when you click that button the Click event fires for ALL these elements (button, then panel, then listboxitem, then listbox, then window) and in each of these events you can see where it originated, you can see the location of the click relative to any of these elements, etc. It sounds exactly like what you need.
You say that you start from scratch, so this might be a good time to make the switch.
-
Mar 4th, 2011, 04:23 PM
#7
Thread Starter
Junior Member
Re: Transparent drawing layer
So I've decided to go with WPF. Problem is, a WPF user control doesn't seem compatable with OCX controls? Any solutions to this?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|