Draw parent pixel on a Control Client Area

Posted on 2002-07-14
Last Modified: 2013-11-20
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  ??
Question by:raqadi
  • 4
  • 3

Expert Comment

ID: 7152761
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)?

Author Comment

ID: 7153494
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...!!
LVL 31

Expert Comment

ID: 7153723
Maybe you need to override WM_ERASEBKGND message to avoid the enclosing rectangle is filled with background color.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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


Author Comment

ID: 7153736
mr Zoppo, do you mean that the background of my control Appears on those corners ??
LVL 31

Accepted Solution

Zoppo earned 100 total points
ID: 7153764
Well, I guess so ... BTW, I found another interesting thing.
Take a look at;en-us;Q125669

There it's stated that one should use SetWindowRgn() to create
none-rectangular windows. Try this first.
LVL 31

Expert Comment

ID: 7153767
BTW, there's no need to call me 'mr' :o)
(only makes me feeling old)

Author Comment

ID: 7153807
Thanx Zoppo; my dear :0).

im soo happy now, and you are the cause.
LVL 31

Expert Comment

ID: 7153814
You're welcome,

I'm glad that I could help you :)

havea nice day,



Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a Shell script to start a service checking the port 6 52
VB.NET how to use the Vertical ScrollBar 5 114
not able to insert into temp table 68 169
either24  challenge 19 101
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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