Click here to Skip to main content
15,883,705 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionComboBox / Win32 [modified] Pin
Fareed Rizkalla7-Apr-10 2:27
Fareed Rizkalla7-Apr-10 2:27 
QuestionRe: ComboBox / Win32 Pin
CPallini7-Apr-10 2:31
mveCPallini7-Apr-10 2:31 
AnswerRe: ComboBox / Win32 Pin
Fareed Rizkalla7-Apr-10 2:38
Fareed Rizkalla7-Apr-10 2:38 
GeneralRe: ComboBox / Win32 Pin
CPallini7-Apr-10 2:50
mveCPallini7-Apr-10 2:50 
QuestionRe: ComboBox / Win32 Pin
Fareed Rizkalla7-Apr-10 3:15
Fareed Rizkalla7-Apr-10 3:15 
QuestionRe: ComboBox / Win32 Pin
CPallini7-Apr-10 3:18
mveCPallini7-Apr-10 3:18 
AnswerRe: ComboBox / Win32 Pin
Sauro Viti7-Apr-10 6:54
professionalSauro Viti7-Apr-10 6:54 
QuestionWhy does GDI+ DrawString punch holes in the alpha channel? Pin
Code-o-mat7-Apr-10 2:24
Code-o-mat7-Apr-10 2:24 
Hello folks!

I got an annoying anomaly with GDI+ i just can't understand. I created a 32 bit bitmap in memory, did some drawing on it and used it to display a layered window. This all works well except for one thing. I use Gdipluss::Graphics::DrawString to render some text onto this bitmap which seems to erase the alpha channel on the bitmap everywhere where letters of the text are drawn. Here's the simplified code i use:
...
  Gdiplus::Graphics     Gx(MemDC);
  Gdiplus::SolidBrush   GxTextBrush(Gdiplus::Color(0, 0, 0));
  Gdiplus::Font         GxFont(MemDC, &LFont); //LFont is a LOGFONT and it is initialized to the default GUI font.

  Gdiplus::RectF TextRect;
  //... init textrect to the correct position...

  Gdiplus::StringFormat GxFormat;
  //... set GxFormat to the needed values...

  Gx.DrawString(text, textlength, &GxFont, TextRect, &GxFormat,  &GxTextBrush);
  ...

Changing the GxTextBrush's color by adding an alpha component of 254 "fixes" the problem, but adding 255 produces the holes again, also making the font bold (LFont.lfWeight = FW_BOLD) seems to fix the problem also... so could someone please tell me what's the logic behind this? For now i set the alpha to 254 and go on with it...
Thanks for any light-sheding attempts in advance.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <

QuestionSend request to open a http link Pin
Pryabu7-Apr-10 1:23
Pryabu7-Apr-10 1:23 
AnswerRe: Send request to open a http link Pin
eusto7-Apr-10 1:26
eusto7-Apr-10 1:26 
AnswerRe: Send request to open a http link Pin
Code-o-mat7-Apr-10 2:25
Code-o-mat7-Apr-10 2:25 
GeneralRe: Send request to open a http link [modified] Pin
Pryabu7-Apr-10 18:57
Pryabu7-Apr-10 18:57 
GeneralRe: Send request to open a http link Pin
eusto8-Apr-10 0:18
eusto8-Apr-10 0:18 
GeneralRe: Send request to open a http link Pin
Pryabu8-Apr-10 21:10
Pryabu8-Apr-10 21:10 
Questionenum in .c-file Pin
LionAM7-Apr-10 1:06
LionAM7-Apr-10 1:06 
AnswerRe: enum in .c-file Pin
Eugen Podsypalnikov7-Apr-10 1:19
Eugen Podsypalnikov7-Apr-10 1:19 
GeneralRe: enum in .c-file Pin
LionAM7-Apr-10 2:05
LionAM7-Apr-10 2:05 
AnswerRe: enum in .c-file Pin
eusto7-Apr-10 1:22
eusto7-Apr-10 1:22 
AnswerRe: enum in .c-file Pin
CPallini7-Apr-10 1:33
mveCPallini7-Apr-10 1:33 
QuestionMaximum limit of char array? Pin
jannathali6-Apr-10 22:33
jannathali6-Apr-10 22:33 
QuestionRe: Maximum limit of char array? Pin
CPallini6-Apr-10 22:35
mveCPallini6-Apr-10 22:35 
AnswerRe: Maximum limit of char array? Pin
jannathali6-Apr-10 22:38
jannathali6-Apr-10 22:38 
GeneralRe: Maximum limit of char array? Pin
«_Superman_»6-Apr-10 22:42
professional«_Superman_»6-Apr-10 22:42 
GeneralRe: Maximum limit of char array? Pin
CPallini6-Apr-10 22:48
mveCPallini6-Apr-10 22:48 
AnswerRe: Maximum limit of char array? Pin
Cedric Moonen7-Apr-10 0:12
Cedric Moonen7-Apr-10 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.