Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » How to know if I am drawing on screen?
How to know if I am drawing on screen? [message #25717] |
Tue, 09 March 2010 09:49 |
chickenk
Messages: 169 Registered: May 2007 Location: Grenoble, France
|
Experienced Member |
|
|
Hi,
I'd like to know the best way to get information, whether my draw object will draw on screen or on an image, for example.
I saw somewhere such code:
func(Draw& w)
{
if(w.IsGui())
... // We are on screen
else
... // other cases
}
But after looking deeper, IsGui() is true on Windows with GDI, but is false under X11 (See implementation of SystemDraw::GetInfo()).
So I suspect this is not the right way... What is better ?
Thanks
Lionel
|
|
|
|
Re: How to know if I am drawing on screen? [message #25724 is a reply to message #25722] |
Tue, 09 March 2010 11:59 |
chickenk
Messages: 169 Registered: May 2007 Location: Grenoble, France
|
Experienced Member |
|
|
mrjt wrote on Tue, 09 March 2010 11:49 | I don't think there is a specific way to do this. The idea is that you shouldn't care.
Maybe you could do:
if (dynamic_cast<SystemDraw>(&w)) {
// Drawing to screen
}
else {
// Drawing to some kind of buffer
}
|
Thanks, good idea. I used dynamic_cast<SystemDraw*>(&w).
I agree that I should not care but in fact, this is not my code. I am trying to get antialiasing to work correctly for the Scatter control from Bazaar.
regards,
Lionel
|
|
|
Goto Forum:
Current Time: Sat Jun 01 05:50:11 CEST 2024
Total time taken to generate the page: 0.01566 seconds
|