Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

1 solution

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[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900