|
Thanks, I did mean at runtime.
|
|
|
|
|
The sample is in MSDN. Try looking for "transblt", "transblit" or something like that.
|
|
|
|
|
Roger.
TransparentBlt(), Thanks.
|
|
|
|
|
At www.wdj.com they have my Sept 2001 article online, which does exactly this to draw a bitmap with color keying, which is what I presume you want to do.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Thanks for your reply. I came up with some unexpected results regarding timing of the calls during a profiling.
I tried four different methods to draw an ellipse. The first method is obviously direct, the following three uses precreated bitmaps or icons.
I put them in a loop and:
% of time spent | call |
---|
18,91 | pDC->Ellipse(...) | 19,58 | pDC->DrawState(...) | 12,89 | pDC->DrawIcon(...) | 35,59 | pDC->MaskBlt(...) |
MaskBlt didn't at all perform as I expected. Do you have any clue to why?
(One reason could be the size of the drawings. The actual ellipse drawn has a radius of 3, while the icons and bitmaps I used was of size 32 by 32 including the ellipse, still sized with a radius of 3)
(I used your method to create a monochrome bitmap.)
Christian Graus wrote:
At www.wdj.com they have my Sept 2001 article online
BTW, is there any site where you don't post articles? I bet a search on AltaVista for NOT "Christian Graus" will give me no hits at all
|
|
|
|
|
Hoho, that was some nice formatting
It should have read:
Thanks for your reply. I came up with some unexpected results regarding timing of the calls during a profiling.
I tried four different methods to draw an ellipse. The first method is obviously direct, the following three uses precreated bitmaps or icons.
I put them in a loop and:
(Skipping <table> fancy stuff this time)
% of time spent call
18,91 pDC->Ellipse(...)
19,58 pDC->DrawState(...)
12,89 pDC->DrawIcon(...)
35,59 pDC->MaskBlt(...)
MaskBlt didn't at all perform as I expected. Do you have any clue to why?
(One reason could be the size of the drawings. The actual ellipse drawn has a radius of 3, while the icons and bitmaps I used was of size 32 by 32 including the ellipse, still sized with a radius of 3)
(I used your method to create a monochrome bitmap.)
Christian Graus wrote:
At www.wdj.com they have my Sept 2001 article online
BTW, is there any site where you don't post articles? I bet a search on AltaVista for NOT "Christian Graus" will give me no hits at all
|
|
|
|
|
I have been at work for 15 hours, and I'm stuck on this - it used to work but now doesn't. Basicaaly I have an XMLDocument and it has a set of child nodes in a NodeListPtr, which I want to copy into another document, so I set through them all and use appendChild to copy them to the other document, and cloneNode(VARIANT_TRUE) to make sure I put in a deep copy. It now blows up on the appendChild call, every time that the node has come from another parent document. The docs seem to say I *can* do this, I'm sure I *have* done this ( this is old code that just stopped working ), so can anyone tell me where I am going wrong ?
The code looks something like this:
IXMLDOMNodeListPtr ptList = spDoc1->FindNode("/XML/blah"); // works OK
IXMLDOMNodePtr ptOther = spDoc2->CreateNode("/XML/location"(; // Works OK
while (ptNode = ptList->nextNode()) // works OK
{
ptCopy = ptNode->cloneNode(VARIANT_TRUE); // works OK
ptOther->appendNode(ptCopy); // This blows up, no matter how I slice & dice it
}
This is a rough idea, but the lines marked with 'works OK' work, if there's any error in my post, it's not present in my code.
Thanks.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Hi Chris, this is a shoot in the dark, so I hope I won't hurt anybody. Could it be that ptCopy is not implementing OK the AddRef /Release stuff? Why don't you try using a local variable?
while (ptNode = ptList->nextNode())
{
IXMLDOMNodePtr ptCopy = ptNode->cloneNode(VARIANT_TRUE);
ptOther->appendNode(ptCopy);
} I doubt this will fix the problem, but it is easy to give a try.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm drawing graphics with OpenGL in an MDI application. In my OnDraw() function, I have the following portion of code:
if(spin==1)
{
Y_Angle++;
Invalidate(TRUE);
}
I have a button which makes spin=1. So when I press this, Y_Angle will continue to increment and then Invalidate(TRUE) redraws the scene each time, giving the appearance of continuous rotation. This works fine. Problem is, when I click any menu thats supposed to bring up a dialog box, the box doesn't come up. I have a feeling this has something to do with Invalidate(TRUE) continuously redrawing the scene. How can I fix this?
|
|
|
|
|
First of all, I'll make sure it is the continuous calling to Invalidate that is causing the problem. To determine this, simply comment the call out and check if the dialog box appears now.
Assumming that is indeed the problem, try setting a timer and calling Invalidate there. Check Nemanja Trifunovic's Timers tutorial for further info on timers.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Don't know if this should be in the Operating Systems area but I was just wondering if anybody knows how to get the username of the person logged on a machine on a novell network.
Basically I'm making a program that I only want a number of people I know to be able to use [chances are it will be distributed without my knowledge] and the program will only be run on my college network [running mainly win2k machines on a novell network]. So i want to be able to read the username of the person logged in an compare this against a list of allowable usernames [probably private data members or in a struct somewhere] within the program.
Any help greatly appreciated.
dela
Now taking suggestionsfor a new sig. please email me all suggestions.
|
|
|
|
|
I don't know how Novel networks integrate with Win2k, but could it be that <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_9jj9.asp">GetUserName</a> provides you with the info you're after?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx... I should have found that myself!!!
Now taking suggestionsfor a new sig. please email me all suggestions.
|
|
|
|
|
Hi! I'm a very beginner in VC++ programming and
I have some trouble with it.
Before C++ I used VB and Pascal and there were some routines for converting an int to a char*
and vice versa (Str and Val). But I cannot find them in C++!
If you know the answer for my question, please
help me!
Thanks.
|
|
|
|
|
This is one way:
int i=101;
char str[256];
sprintf(str,"%d",i);
char * str="101";
int i;
sscanf(str,"%d",&i);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you!
|
|
|
|
|
|
Of course atoi is an excellent alternative. I guess I chose sscanf just for symmetry with sprintf .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, does any one have or know a site to get a C or C++ implementation of Prim's algorithm for finding a Minumum Spanning Tree?
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
I can recommend "Introduction to Algorithms" by Cormen, Leiserson and Rivest. ISBN 0-262-03141-8 (MIT-press) or ISBN 0-07-013143-0 (McGraw-Hill). My printing is from -92, and there could be newer ones. It (or the like) should be part of every programmers library. It contains pseudo-code examples, easy to convert into C++.
|
|
|
|
|
The Boost Graph Library implements this algorithm (and a lot more). Plus, it is a beatifully crafted library, if you like the STL way.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here's the question - I use threads of type "UINT MyFunc(LPVOID pParam)" and inside I pass CListCtrl pointer and use MFC classes as CString. Is that correct - I mean can I loose in some conditions information?
|
|
|
|
|
It's ugly as anything, you can thank Microsoft for that. But it will work fine.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I come back with an old question: how could i bring a modeless dialog box to background? Background meaning behind the parent window, not hiding.
Is it possible by changing the modeless' settings?
Wish for help!
rechi
|
|
|
|
|
No you can't change the modeless settings. All that modeless means is that it uses the main message loop to get access to its messages. A modal dialog box creates and uses its own message loop.
Have you tried to set the ZOrder of the windows in order to make your dialog set behind the main one? Use SetWindowpos for this.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|