• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Draw parent pixel on a Control Client Area

i want to make some pixels transparent on my control, i need to do that by drawing the parent's pixels that lies behind the intended pixel on the control instread of it ( instead of the pixels on the controls), so how can i do that without setting the control window style to WS_EX_TRANSPARENT  ??
0
raqadi
Asked:
raqadi
  • 4
  • 3
1 Solution
 
fl0ydCommented:
You cannot -- there is no way to find out for sure what a specific pixel should be if a window obscuring it wasn't there. It is there and thus the OS doesn't care about what it WOULD be otherwise. Why are you so opposed to using the way to go (i.e. use WS_EX_TRANSPARENT)?
0
 
raqadiAuthor Commented:
The problem is that im drawing my control using RoundRect function, but the corners of the control rectangle that will remains out of the rounded rectangle still have a color, i want these corners to be removed, and i dont find any way to do that...!!
0
 
ZoppoCommented:
Maybe you need to override WM_ERASEBKGND message to avoid the enclosing rectangle is filled with background color.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
raqadiAuthor Commented:
mr Zoppo, do you mean that the background of my control Appears on those corners ??
0
 
ZoppoCommented:
Well, I guess so ... BTW, I found another interesting thing.
Take a look at http://support.microsoft.com/default.aspx?scid=kb;en-us;Q125669

There it's stated that one should use SetWindowRgn() to create
none-rectangular windows. Try this first.
0
 
ZoppoCommented:
BTW, there's no need to call me 'mr' :o)
(only makes me feeling old)
0
 
raqadiAuthor Commented:
Thanx Zoppo; my dear :0).

im soo happy now, and you are the cause.
0
 
ZoppoCommented:
You're welcome,

I'm glad that I could help you :)

havea nice day,

regards,

ZOPPO
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now