Click to See Complete Forum and Search --> : Drawing Over A Bitmap?
hatflyer
May 20th, 2004, 06:32 PM
I have a graph that displays varying bars, depending on the user input. The base of the graph (the axes, labels) are always the same. Is it possible to load an icon of the base graph, and then draw over it?
Thanks,
Jim
indiocolifa
May 21st, 2004, 11:55 PM
yes, but load an "icon"???
preferably, load a Bitmap (or more specifically, create a bitmap surface on RAM, load your image, "paste" on the surface and draw the other things you want to superimpose...)
hatflyer
May 22nd, 2004, 10:56 AM
Thanks for the reply.
I'm not sure what you mean by the surface of RAM and pasting on the surface. Is this different than doing a standard load bitmap?
Thanks,
JIm
indiocolifa
May 22nd, 2004, 11:01 AM
surface, in terms of "directdraw surfaces"... device contexts, in terms of GDI, or Graphics object in the GDI+ world.
But, the bitmap loading is standard of course.
hatflyer
May 22nd, 2004, 12:04 PM
I think I tried it and it did not work.
I have a bitmap that is displayed. It was loaded automatically (I placed it using the resource view).
To draw over it, this is what I did in OnPaint():
CPaintDC dc(this); // device context for painting
//...create points
dc.MoveTo(ArrowStart.x,ArrowEnd.y);
dc.LineTo(ArrowEnd);
The line disappears when it gets to the bitmap.
Is it a matter of which gets placed on top of the other?
JIm
indiocolifa
May 22nd, 2004, 12:43 PM
yes, check how the lines are superimposing on the bitmap.
Maybe you need to set SetROP2 to an appropiate value.
check out setrop2 function in MSDN.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.