Click here to Skip to main content
15,921,548 members
Home / Discussions / Graphics
   

Graphics

 
GeneralRe: Flashy GDI+ Pin
Christian Graus6-Apr-08 16:30
protectorChristian Graus6-Apr-08 16:30 
QuestionTemplate Matching? Pin
jamilkhan00727-Mar-08 21:45
jamilkhan00727-Mar-08 21:45 
QuestionHighest quality text using TextRender Pin
danreber18-Mar-08 6:16
danreber18-Mar-08 6:16 
GeneralRe: Highest quality text using TextRender Pin
Rob Smiley18-Apr-08 11:43
Rob Smiley18-Apr-08 11:43 
QuestionErasing a line C# Pin
Denver Thomas17-Mar-08 20:32
Denver Thomas17-Mar-08 20:32 
GeneralRe: Erasing a line C# Pin
Pete O'Hanlon18-Mar-08 11:33
mvePete O'Hanlon18-Mar-08 11:33 
QuestionWhat thing is done from IStream::Read to IWMReaderCallbackAdvanced::OnStreamSample? Pin
markliu-codeproject16-Mar-08 22:14
markliu-codeproject16-Mar-08 22:14 
GeneralCreateDIBitmap with 32bits RGBA data Pin
Vlasta_12-Mar-08 23:02
Vlasta_12-Mar-08 23:02 
Hello all,

I seem to have a problem creating bitmaps with alpha with the following code:

BITMAPINFO tBMI;
ZeroMemory (&tBMI, sizeof tBMI);
tBMI.bmiHeader.biSize = sizeof tBMI.bmiHeader;
tBMI.bmiHeader.biWidth = nSizeX;
tBMI.bmiHeader.biHeight = -nSizeY;
tBMI.bmiHeader.biPlanes = 1;
tBMI.bmiHeader.biBitCount = 32;
tBMI.bmiHeader.biCompression = BI_RGB;
HBITMAP hBmp = CreateDIBitmap(hdc, &tBMI.bmiHeader, CBM_INIT, pData, &tBMI, DIB_RGB_COLORS);

All works fine under normal circumstances, but if it happens that the data are completely transparent (all pixels have alpha set to 0), the behavior suddenly changes and instead of a completely transparent bitmap, the function chooses to ignore the alpha channel and creates a bitmap filled with black color (presumably because the RGB channels were set to 0 in the original data).

Is this some Microsoft hack to maintain compatibility or what? Is there a way to prevent it? Thanks for any hints.
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 7:32
Mark Salsbery13-Mar-08 7:32 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 8:24
Vlasta_13-Mar-08 8:24 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 8:28
Mark Salsbery13-Mar-08 8:28 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Michael Dunn13-Mar-08 10:30
sitebuilderMichael Dunn13-Mar-08 10:30 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 10:53
Vlasta_13-Mar-08 10:53 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 11:00
Vlasta_13-Mar-08 11:00 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 11:25
Mark Salsbery13-Mar-08 11:25 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 11:31
Mark Salsbery13-Mar-08 11:31 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 12:30
Vlasta_13-Mar-08 12:30 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Mark Salsbery13-Mar-08 13:25
Mark Salsbery13-Mar-08 13:25 
GeneralRe: CreateDIBitmap with 32bits RGBA data Pin
Vlasta_13-Mar-08 14:04
Vlasta_13-Mar-08 14:04 
Generaldirectsound can not be initized Pin
mwolf12212-Mar-08 16:39
mwolf12212-Mar-08 16:39 
GeneralControlStyles.DoubleBuffer Issue Pin
Harvey Saayman7-Mar-08 2:12
Harvey Saayman7-Mar-08 2:12 
GeneralRe: ControlStyles.DoubleBuffer Issue Pin
Luc Pattyn7-Mar-08 2:20
sitebuilderLuc Pattyn7-Mar-08 2:20 
GeneralRe: ControlStyles.DoubleBuffer Issue Pin
Harvey Saayman9-Mar-08 20:23
Harvey Saayman9-Mar-08 20:23 
GeneralRe: ControlStyles.DoubleBuffer Issue Pin
Luc Pattyn10-Mar-08 0:51
sitebuilderLuc Pattyn10-Mar-08 0:51 
GeneralRe: ControlStyles.DoubleBuffer Issue Pin
Harvey Saayman10-Mar-08 1:22
Harvey Saayman10-Mar-08 1:22 

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.