Click here to Skip to main content
15,884,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Coin Change Problem Error Pin
CPallini17-Nov-09 7:10
mveCPallini17-Nov-09 7:10 
QuestionTransparent lines in C Pin
Rozis17-Nov-09 3:21
Rozis17-Nov-09 3:21 
AnswerRe: Transparent lines in C Pin
Code-o-mat17-Nov-09 3:38
Code-o-mat17-Nov-09 3:38 
GeneralRe: Transparent lines in C Pin
Rozis17-Nov-09 3:56
Rozis17-Nov-09 3:56 
GeneralRe: Transparent lines in C Pin
Code-o-mat17-Nov-09 4:04
Code-o-mat17-Nov-09 4:04 
General[Message Deleted] Pin
KingsGambit17-Nov-09 4:13
KingsGambit17-Nov-09 4:13 
GeneralRe: Transparent lines in C Pin
Code-o-mat17-Nov-09 4:34
Code-o-mat17-Nov-09 4:34 
GeneralRe: Transparent lines in C Pin
Rozis17-Nov-09 5:22
Rozis17-Nov-09 5:22 
I'll try to answer both...

Alphablend() has a parameter that determines a global transparency. Suppose I want 2 lines with different transparencies i must use Alphablend() 2 times. And drawing 2 times tranparently to the screen will change the original pixels (those that are not from the lines). In other words: I can copy the screen to the memoryDC, draw the line and alphablend it to the screen but then all pixels are changed. This is why a regionobject is required. So the solution of Rejeesh can not work.

The first suggestion of Code-o-mat is too slow. But his 2nd approach may have some opportunities. If i understand you well Code-o-mat essentially you say to me: manipulate the alpha-channel according to the line drawn... Thus if i could draw the line directly in the alpha-channel my problem would be solved. Unfortunally there's not such function... but maybe i can write one...

Maybe an approach can be: create a memoryDC, a 32-BPP bitmap and an addional 8-bit black and white bitmap. Draw the lines on the 8-bit bitmap (and also on the 32-bit bitmap) and finally merge the 8-bit image as an alpha-channel to the 32-bit bitmap. This means: no regions needed, no manual line draws and only one time comsuming operation (the merging of the alpha-channel. Sounds promissing!

Anyone any better ideas?
GeneralRe: Transparent lines in C Pin
Code-o-mat17-Nov-09 5:35
Code-o-mat17-Nov-09 5:35 
GeneralRe: Transparent lines in C Pin
Rozis17-Nov-09 6:17
Rozis17-Nov-09 6:17 
GeneralRe: Transparent lines in C Pin
Tim Craig17-Nov-09 8:45
Tim Craig17-Nov-09 8:45 
GeneralRe: Transparent lines in C Pin
Rozis17-Nov-09 9:41
Rozis17-Nov-09 9:41 
AnswerRe: Transparent lines in C Pin
KingsGambit17-Nov-09 4:39
KingsGambit17-Nov-09 4:39 
Questionget the window's rect Pin
itay1017-Nov-09 2:46
itay1017-Nov-09 2:46 
AnswerRe: get the window's rect Pin
Richard MacCutchan17-Nov-09 3:10
mveRichard MacCutchan17-Nov-09 3:10 
GeneralRe: get the window's rect Pin
itay1017-Nov-09 5:23
itay1017-Nov-09 5:23 
AnswerRe: get the window's rect [modified] Pin
Code-o-mat17-Nov-09 3:11
Code-o-mat17-Nov-09 3:11 
GeneralRe: get the window's rect Pin
Richard MacCutchan17-Nov-09 6:22
mveRichard MacCutchan17-Nov-09 6:22 
GeneralRe: get the window's rect Pin
Code-o-mat17-Nov-09 6:34
Code-o-mat17-Nov-09 6:34 
QuestionRe: get the window's rect Pin
CPallini17-Nov-09 3:15
mveCPallini17-Nov-09 3:15 
AnswerRe: get the window's rect Pin
itay1017-Nov-09 5:21
itay1017-Nov-09 5:21 
QuestionRe: get the window's rect Pin
David Crow17-Nov-09 5:55
David Crow17-Nov-09 5:55 
AnswerRe: get the window's rect Pin
itay1017-Nov-09 7:06
itay1017-Nov-09 7:06 
GeneralRe: get the window's rect Pin
David Crow17-Nov-09 7:08
David Crow17-Nov-09 7:08 
GeneralRe: get the window's rect Pin
CPallini17-Nov-09 6:03
mveCPallini17-Nov-09 6:03 

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.