Click here to Skip to main content
13,044,935 members (45,497 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hey Friends

Any idea of how i can draw a text using CDC with Transparency / Opacity ?

Something like Watermarking[^] in MFC ?

On Windows there is option of making Windows Alpha Blend / Transparent using something like
typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD);
 
static PSLWA pSetLayeredWindowAttributes = NULL;
static BOOL initialized = FALSE;
 

BOOL MakeWindowTransparent(HWND hWnd, unsigned char factor)
{
   /* First, see if we can get the API call we need. If we've tried
    * once, we don't need to try again. */
   if (!initialized)
   {
      HMODULE hDLL = LoadLibrary ("user32");
 
      pSetLayeredWindowAttributes = 
         (PSLWA) GetProcAddress(hDLL, "SetLayeredWindowAttributes");
 
      initialized = TRUE;
   }
 
   /* ... elided ... */
}


Is there any related way for Text ?


Regards
Posted 17-Feb-13 9:14am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Perhaps this will help you

C++ GDI+ drawing text on a transparent layered window
http://stackoverflow.com/questions/4783781/c-gdi-drawing-text-on-a-transparent-layered-window[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100