Click here to Skip to main content
15,908,254 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Eject CDROM in W98??? Pin
Tomasz Sowinski9-Nov-01 1:58
Tomasz Sowinski9-Nov-01 1:58 
AnswerRe: Eject CDROM in W98??? Pin
Carlos Antollini9-Nov-01 2:40
Carlos Antollini9-Nov-01 2:40 
AnswerRe: Check this ;) Pin
Masaaki Onishi9-Nov-01 4:17
Masaaki Onishi9-Nov-01 4:17 
GeneralRe: Check this ;) Pin
Alex Lewandowski9-Nov-01 4:40
Alex Lewandowski9-Nov-01 4:40 
GeneralRe: Ty, but... Pin
Masaaki Onishi9-Nov-01 5:23
Masaaki Onishi9-Nov-01 5:23 
GeneralWhich is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 1:32
Chambers9-Nov-01 1:32 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 1:54
Tomasz Sowinski9-Nov-01 1:54 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 2:25
Chambers9-Nov-01 2:25 
I`m using XP Business Edition RC1 at the moment, so god knows what its gonna be like on this. I`m using an adapted version of Christians code, which uses a good few Blts, including a few SRCANDS (they really are speed killers) raster operations. I have heard of a method using one BitBlt (or StretchBlt) and SRCCOPY, but it doesn`t seem to work. I`ll post the code here, and if anyone can see whats wrong cool (remember this is NOT my code, so if it raises any questions, chances are I won`t know the answer).

//Only attempt this if device supports functionality.
if(GetDeviceCaps(hdcDest, CAPS1) &C1_TRANSPARENT)
{
//Special transparency background mode.
oldMode = SetBkMode(hdcDest, NEWTRANSPARENT);
rgbBk = SetBkColor(hdcDest, rgbTransparent);
//Actual blt is a simple source copy; transparency is automatic.
BitBlt(hdcDest, x, y, dx, dy, hdcSrc, x0, y0, SRCCOPY);
SetBkColor(hdcDest, rgbBk);
SetBkMode(hdcDest, oldMode);
}


Of course, this code doesn`t compile cause it don`t say what oldMode and rgbBk are variables of any particualar type. Even then NEWTRANSPARENT is undefined (I assumed whoever wrote the code #defined it to be = to 1, as SetBkMode's second argument is either 0 (Opaque) or 1(Transparent) as I understand it). I then assumed rgbTransparent to be the colour I don`t want copied onto the CDC (so I gave it a fixed value of 0 for black). Despite all this, it still don`t blinking work. This code would have been perfect for me, had it worked, because my programs layers need to be drawn (and re-drawn) fairly quickly. The strange thing is that Delphi actually manages to cope with this mechanism superbly, with not much performance loss at all, so I know there is a way get the desired results, but what is it?

Anyway cheers all for reading this far (again), and cheers Tomasz for the quick reply,
Alan.Confused | :confused:


"When I left you I was but the learner, now I am the Master" - Darth VaderMad | :mad:
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 2:36
Tomasz Sowinski9-Nov-01 2:36 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 2:39
Chambers9-Nov-01 2:39 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Tomasz Sowinski9-Nov-01 2:43
Tomasz Sowinski9-Nov-01 2:43 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers9-Nov-01 4:45
Chambers9-Nov-01 4:45 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Christian Graus9-Nov-01 9:59
protectorChristian Graus9-Nov-01 9:59 
GeneralRe: Which is faster TransparentBlt or AlphaBlend Pin
Chambers13-Nov-01 1:32
Chambers13-Nov-01 1:32 
Generalabout Registry Pin
Maer7279-Nov-01 1:28
Maer7279-Nov-01 1:28 
GeneralRe: about Registry Pin
Michael P Butler9-Nov-01 1:31
Michael P Butler9-Nov-01 1:31 
GeneralRe: about Registry Pin
Maer7279-Nov-01 1:44
Maer7279-Nov-01 1:44 
GeneralRe: about Registry Pin
Michael P Butler9-Nov-01 1:50
Michael P Butler9-Nov-01 1:50 
GeneralRe: about Registry Pin
Maer7279-Nov-01 18:28
Maer7279-Nov-01 18:28 
GeneralRe: about Registry Pin
Nish Nishant9-Nov-01 4:25
sitebuilderNish Nishant9-Nov-01 4:25 
GeneralRe: about Registry Pin
Maer7279-Nov-01 18:25
Maer7279-Nov-01 18:25 
GeneralCListCtrl window disappears?! Pin
Tommy H D Svensson8-Nov-01 22:57
Tommy H D Svensson8-Nov-01 22:57 
GeneralRe: CListCtrl window disappears?! Pin
Tomasz Sowinski8-Nov-01 23:30
Tomasz Sowinski8-Nov-01 23:30 
GeneralRe: CListCtrl window disappears?! Pin
Tommy H D Svensson9-Nov-01 1:13
Tommy H D Svensson9-Nov-01 1:13 
GeneralRe: CListCtrl window disappears?! Pin
Tomasz Sowinski9-Nov-01 1:27
Tomasz Sowinski9-Nov-01 1:27 

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.