Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: cannot convert from 'double' to 'class _variant_t * Pin
Iain Clarke, Warrior Programmer7-Apr-10 10:03
Iain Clarke, Warrior Programmer7-Apr-10 10:03 
AnswerRe: cannot convert from 'double' to 'class _variant_t * Pin
Eugen Podsypalnikov7-Apr-10 10:04
Eugen Podsypalnikov7-Apr-10 10:04 
Questionresolving a shortcut file name Pin
Alan Kurlansky7-Apr-10 9:30
Alan Kurlansky7-Apr-10 9:30 
AnswerRe: resolving a shortcut file name Pin
Nuri Ismail7-Apr-10 10:10
Nuri Ismail7-Apr-10 10:10 
QuestionIs forward declaration a hack for bad, lazy programmers? Pin
Vaclav_7-Apr-10 7:16
Vaclav_7-Apr-10 7:16 
AnswerRe: Is forward declaration a hack for bad, lazy programmers? Pin
Chris Losinger7-Apr-10 7:25
professionalChris Losinger7-Apr-10 7:25 
AnswerRe: Is forward declaration a hack for bad, lazy programmers? PinPopular
Moak7-Apr-10 7:48
Moak7-Apr-10 7:48 
GeneralRe: Is forward declaration a hack for bad, lazy programmers? Pin
William Winner7-Apr-10 11:41
William Winner7-Apr-10 11:41 
GeneralOfftopic Pin
Moak7-Apr-10 11:57
Moak7-Apr-10 11:57 
AnswerRe: Is forward declaration a hack for bad, lazy programmers? PinPopular
Nemanja Trifunovic7-Apr-10 7:59
Nemanja Trifunovic7-Apr-10 7:59 
AnswerRe: Is forward declaration a hack for bad, lazy programmers? Pin
Eugen Podsypalnikov7-Apr-10 9:24
Eugen Podsypalnikov7-Apr-10 9:24 
QuestionCString convert error in Embedded Visual C++ Pin
CHYGO7-Apr-10 4:20
CHYGO7-Apr-10 4:20 
AnswerRe: CString convert error in Embedded Visual C++ Pin
eusto7-Apr-10 4:42
eusto7-Apr-10 4:42 
GeneralRe: CString convert error in Embedded Visual C++ Pin
CHYGO7-Apr-10 5:18
CHYGO7-Apr-10 5:18 
JokeRe: CString convert error in Embedded Visual C++ Pin
Eugen Podsypalnikov7-Apr-10 5:38
Eugen Podsypalnikov7-Apr-10 5:38 
GeneralRe: CString convert error in Embedded Visual C++ Pin
CHYGO8-Apr-10 2:01
CHYGO8-Apr-10 2:01 
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 

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.