|
-
Apr 16th, 2002, 05:49 PM
#1
Drawing on a transparent usercontrol...
I need to be able to overlap usercontrols with userdrawn items on them. Unfortunately, the shapes I'm drawing get covered up by the other usercontrols. Is there a way to have a transparent control that still allows drawing code to work? I've tried setting the Windowless property to True, and it didn't do anything.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 16th, 2002, 08:23 PM
#2
*snert*
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 16th, 2002, 10:46 PM
#3
All right, one last bump, then I'll let this die...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 16th, 2002, 10:59 PM
#4
Hyperactive Member
dont quite understand your scenario. By UserControls are you talking custom activeX usercontrols? and when you say your shapes on the 1st usercontrol are covered up by another usercontrol... what do you want it to do? have your shapes jump onto the 2nds usercontrol?
...im confused
-
Apr 16th, 2002, 11:06 PM
#5
Yup, ActiveX controls.
Here's the scenario...
I'm drawing shapes on the control the Line method, the Polygon API, etc. When I overlap these controls on a form, parts of the bottom-most controls are cut off, I'd like to know if there is a way to prevent this. I'll attach a screenshot to illustrate the issue.

Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 16th, 2002, 11:09 PM
#6
I know! But im not telling you because you are always a dink in my threads, so....
-
Apr 16th, 2002, 11:10 PM
#7
Originally posted by carp
I know! But im not telling you because you are always a dink in my threads, so....
Fine, then you don't get any of Lincoln's treasure then...
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 16th, 2002, 11:24 PM
#8
Hyperactive Member
haha ok i see. So basically thats all you wanted, a transparent usercontrol.
What you need to do is Get desktop DC (anything showing at the time) and paint it to the background of the control. Which is tricky...
I BitBlt each pixel of the desktop DC onto my control, whatever part of my control didnt have something on it. In my case i was able to make the control Blue (a color which i never used on it) and if the pixel was Blue then paint the corresponding pixel from the desktopDC.
I put all that into 1 function, then called it in the
UserControl_Resize() and UserControl_Show() Events...
*shrug*
-
Apr 16th, 2002, 11:28 PM
#9
Wow, I didn't think it would take all that, but I'll give it a shot.
Thanks.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Apr 21st, 2002, 04:34 AM
#10
I'm trying to do something similar to achieve translucency on my usercontrols and I've just read the description. It sounds pretty good. But if I was blitting what was on 'behind' the usercontrol onto the usercontrol then the usercontrol needs to be hidden when the blitting takes place.
In my case, the usercontrol is also draggable, ie when it is being dragged, the area blitted to the usercontrol needs to be updated....wouldn't all the hiding/showing cause alot of flickering?
-
Apr 21st, 2002, 08:12 AM
#11
I've actually found a much easier way. Using CreatePolygonRgn and SetWindowRgn worked for me.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
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
|