|
I need to figure out if a HBITMAP/CBitmap has an alpha channel, but bitmap.bmBitsPixel is always 32, no matter if it's a 16-color bitmap or 24-bit+alpha channel bitmap.
|
|
|
|
|
I don't think DDBs support alpha channel, at least not in the standard Windows APIs.
|
|
|
|
|
One way is to see if there are any non-zero values in the alpha channel. If so, they it likely has one, though this is definitely not exact.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Is it possible to overload a pure virtual function?
ie:
<br />
class CSomeClass<br />
{<br />
public:<br />
CSomeClass();<br />
virtual ~CSomeClass();<br />
<br />
virtual void Function1(BOOL parm1, BOOL parm2 = TRUE)=0;<br />
<br />
virtual void Function1(BOOL parm1, BOOL parm2 = TRUE, int parm3 = 0)=0;<br />
long m_lData;<br />
}<br />
Or am I missing something, else? I think I can it's just that it's 5:00pm and my brain is fried.
|
|
|
|
|
Is it possible to overload a pure virtual function?
Yes
Although in your example there will be ambiguity when calling the function because of the
default parameters.
|
|
|
|
|
Mark Salsbery wrote: Although in your example there will be ambiguity when calling the function because of the
default parameters.
As Mark said. Either remove the defaults, at least from the last param or change their types so the function signatures are unique.
|
|
|
|
|
Neville Franks wrote:
... remove the defaults, at least from the last param or change their types so the function signatures are unique.
Yup, that's it. The system is complaining about this exact problem. I'll re-arrainge the order of the last two parms when I hook up my workplace LT later. Thanks. I thought of doing this myself earlier but I was getting frustrated with the whole thing so I took a break. These are the last two bugs I have to work out (until the next two, that is!). :P
Thanks, Guys!
C
|
|
|
|
|
Hi Neville. Haven't seen you around in a while.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ive been using SetPixel alot, where i feed it seperate R G B values, but now im playing with GetPixel, but it only seems to return one big bitwise value, so how can i most cpu friendly wise convert this big number into 3 sperate ints?
thanks
/Johannes
|
|
|
|
|
Johpoke wrote: so how can i most cpu friendly wise convert this big number into 3 sperate ints?
Why not just use GetRValue() , GetGValue() , and GetBValue() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
That sounds right, but how do i connect them or use them correctly? i just get out weird characters, no numbers..
:/
/Johannes
|
|
|
|
|
Johpoke wrote: ...but how do i connect them...
Huh?
Johpoke wrote: i just get out weird characters, no numbers..
How are you using those functions?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
im not sure if im using them correctlt, msdn didnt explain alot, first i tried geting pixel, and sening the int to getrbvale, i also tried some other data types, and last i tied:
cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));
how="" do="" i="" get="" the="" rvalue="" g="" and="" b="" for="" pixel="" seperate??
thanks!
=""
<div="" class="ForumSig">/Johannes
|
|
|
|
|
Johpoke wrote: cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));<="" blockquote="">
This is doing exactly what it is supposed to (i.e., printing the character equivalent of the red value). Since your red value is likely not a printable character (e.g., some value less than 33 or greater than 127), that's why you're not seeing a number. Cast it to an int instead.
Johpoke wrote: how do i get the Rvalue G and B for the pixel seperate??
By using the three functions I mentioned earlier.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yep feeding it into int, or doing int(GetR... works great
thanks for the help!
/Johannes
|
|
|
|
|
Hi,
I'm trying to control another application (Acrobat 5 print settings) and I'm telling it to check a checkbox which is working ok, but when I click OK button and go back in the setting is lost. (unchecked)
If I do it manually with mouse then it saves the information, so my question is:-
is there any further window messages to send to the checkbox or window to save the information in the app, I've tried sending UpdateData and UpdateWindow without any luck.
currently doing code:
if(childWnd->GetDlgCtrlID( )==0x63686B39)
{
CButton *btn = (CButton *) wnd2->GetDlgItem(0x63686B39);
btn->SetCheck(TRUE);
}
Thanks,
Lee.
|
|
|
|
|
leemidgley wrote: btn->SetCheck(TRUE);
Checking a checkbox in this manner does not call the OnClickXXX() handler function, which is most likely what saves the checkbox's state.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi everyone,
Sorry if this is the wrong forum to post this question.
I am looking for an API or DLL that can help me with a system benchmark program. I would like to write a little program that rate the performance of the system; processor, memory, primary hard disk (r/w) and graphics. Any help pointing me to the right direction or tips are greatly apprcicated. It would be nice to do this in c/c++. Thanks again for your help.
-hdpc
|
|
|
|
|
hdpc wrote: ...a little program that rate the performance of the system...
What exactly does this mean?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I don't think there is a way in un-managed code, but managed code there are performance counter which are part of WMI (Windows Management Interface)
http://www.codeproject.com/dotnet/perfcounter.asp[^]
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
WMI existed long before managed code was a concept for Microsoft.
|
|
|
|
|
Sam Hobbs wrote: WMI existed long before managed code
It would seem your right.
From WIKI
Under Windows NT 4.0, Microsoft had roughly 15 WMI providers available once WMI was installed.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I'd like to be able to read the results from the listview that I've outlined in blue in the attached photo. Spy shows the class as Afx:400000:28:10011 . It appears to be a listview however I've had no luck with sending standard messages such as LVM_GETITEMCOUNT, LVM_GETITEMTEXT. Just wanted to see if anyone here had any ideas? Thanks for your help!
http://img296.imageshack.us/img296/8471/pstarstourneylobft3.jpg[^]
Also watching the window messages on spy shows that it updates using WM_PAINT.
-- modified at 13:20 Friday 8th December, 2006
|
|
|
|
|
I can tell by looking at it that isn't not a regular list view control.
|
|
|
|