Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
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
0 CPallini 375
1 Sergey Alexandrovich Kryukov 370
2 BillWoodruff 314
3 George Jonsson 274
4 OriginalGriff 257
0 OriginalGriff 5,030
1 CPallini 4,115
2 Sergey Alexandrovich Kryukov 3,554
3 George Jonsson 2,826
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2014
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