Click here to Skip to main content
15,906,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dynamic array Pin
Naveen25-Aug-08 0:59
Naveen25-Aug-08 0:59 
GeneralRe: dynamic array Pin
CPallini25-Aug-08 0:26
mveCPallini25-Aug-08 0:26 
AnswerRe: dynamic array Pin
Perspx24-Aug-08 23:45
Perspx24-Aug-08 23:45 
AnswerRe: dynamic array Pin
Jijo.Raj24-Aug-08 23:54
Jijo.Raj24-Aug-08 23:54 
GeneralRe: dynamic array Pin
Sunday8PM25-Aug-08 0:12
Sunday8PM25-Aug-08 0:12 
AnswerRe: dynamic array Pin
David Crow25-Aug-08 4:51
David Crow25-Aug-08 4:51 
AnswerRe: dynamic array Pin
erkanina8-Sep-08 10:02
erkanina8-Sep-08 10:02 
QuestionMerging two icons(transparent BitBlt) Pin
haimen24-Aug-08 23:13
haimen24-Aug-08 23:13 
I am trying to merge two icons by drawing one image transparently on another, merging the masks and creting a new icon based on the new bitmap and mask.

The code looks like this:

// Get bitmaps for both icons
GetIconInfo(hFirstIcon, &FirstInfo);
GetIconInfo(hSecondIcon, &SecondInfo);
.
// Prepare mem DCs
dcFirstIcon.CreateCompatibleDC(NULL);
dcSecondMask.CreateCompatibleDC(NULL);
dcSecondIcon.CretaeCompatibleDC(NULL);
dcSecondMask.CreateCompatibleDC(NULL);
.
// Select the Icon bitmaps into the appropriate dcs
dcFirstIcon.SelectObject(FirstInfo.hbmColor);
dcFirstMask.SelectObject(FirstInfo.hbmMask);
dcSecondIcon.SelectObject(SecondInfo.hbmColor);
dcSecondMask.SelectObject(SecondInfo.hbmMask);
.
// transparent BitBlt of one image on another (result in dcFirstIcon)
dcFirstIcon.BitBlt(0, 0, IconSize, IconSize, &dcSecondIcon, 0, 0, SRCINVERT);
dcFirstIcon.BitBlt(0, 0, IconSize, IconSize, &dcSecondMask, 0, 0, SRCAND);
dcFirstIcon.BitBlt(0, 0, IconSize, IconSize, &dcSecondIcon, 0, 0, SRCINVERT);
.
// Prepare the megred mask
...
.
// Create the new icon based on the updated bitmap and mask
FirstInfo.fIcon = true;
hMergedIcon = CreateIconIndirect(&FirstInfo);


The result is fine, but on certain icons it kills the icon shadow and makes the shadow solid black and ugly. I tried to use TransparentBlt which in those problematic icons leaves the shadow untouched but this function erases the bits where the second icon should show up and make them white.

I guess it is related somehow to XP style icons or to Alpha channel, but am not familiar with those issues and will appreciate some advice here.

Haim
Questioncompling file in the Debug build, but errors in the Release build. advice Pin
ptr_Electron24-Aug-08 23:01
ptr_Electron24-Aug-08 23:01 
AnswerRe: compling file in the Debug build, but errors in the Release build. advice Pin
CPallini24-Aug-08 23:22
mveCPallini24-Aug-08 23:22 
AnswerRe: compling file in the Debug build, but errors in the Release build. advice Pin
toxcct24-Aug-08 23:23
toxcct24-Aug-08 23:23 
GeneralRe: compling file in the Debug build, but errors in the Release build. advice Pin
santhoshv8425-Aug-08 0:19
santhoshv8425-Aug-08 0:19 
GeneralRe: compling file in the Debug build, but errors in the Release build. advice Pin
toxcct25-Aug-08 0:30
toxcct25-Aug-08 0:30 
AnswerRe: compling file in the Debug build, but errors in the Release build. advice Pin
Jijo.Raj25-Aug-08 1:09
Jijo.Raj25-Aug-08 1:09 
GeneralRe: compling file in the Debug build, but errors in the Release build. advice Pin
ptr_Electron25-Aug-08 1:26
ptr_Electron25-Aug-08 1:26 
QuestionRe: compling file in the Debug build, but errors in the Release build. advice Pin
Jijo.Raj25-Aug-08 1:40
Jijo.Raj25-Aug-08 1:40 
AnswerRe: compling file in the Debug build, but errors in the Release build. advice Pin
ptr_Electron25-Aug-08 1:53
ptr_Electron25-Aug-08 1:53 
QuestionSeparate Window Pin
T.RATHA KRISHNAN24-Aug-08 22:55
T.RATHA KRISHNAN24-Aug-08 22:55 
QuestionI feel it like a repost. Pin
CPallini24-Aug-08 22:58
mveCPallini24-Aug-08 22:58 
AnswerRe: I feel it like a repost. [modified] Pin
Perspx24-Aug-08 23:03
Perspx24-Aug-08 23:03 
QuestionRe: I feel it like a repost. Pin
T.RATHA KRISHNAN24-Aug-08 23:08
T.RATHA KRISHNAN24-Aug-08 23:08 
AnswerRe: I feel it like a repost. Pin
Perspx24-Aug-08 23:18
Perspx24-Aug-08 23:18 
QuestionRe: I feel it like a repost. Pin
T.RATHA KRISHNAN24-Aug-08 23:29
T.RATHA KRISHNAN24-Aug-08 23:29 
AnswerRe: I feel it like a repost. Pin
Perspx24-Aug-08 23:39
Perspx24-Aug-08 23:39 
AnswerRe: I feel it like a repost. Pin
ThatsAlok25-Aug-08 1:24
ThatsAlok25-Aug-08 1:24 

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.