Changing font type in a View
-
In my SDI application I have to write some text in the View. I use TextOut function and it works fine using a Default font size and type (I suppose). I'd like to change font size and type. Is it possible ?? How ?? Thanks a lot !!!
Could you use a CStatic for your Text? CP has plenty of information about CStatic.
My opinions may have changed, but not the fact that I am right.
-
Could you use a CStatic for your Text? CP has plenty of information about CStatic.
My opinions may have changed, but not the fact that I am right.
My View is not a CFormView derived class. I'dont know if it is possible to create a CStatic control in a CView derived class. But I'd prefer to don't use a a CStatic control if it is possible... Text I have to draw changes continously position in my View and must be often created and destroyed so I think that it could be more easy to use TextOut function... But.. how to change font type and size ??? The only why is to create and manage CStatic controls ??
-
Could you use a CStatic for your Text? CP has plenty of information about CStatic.
My opinions may have changed, but not the fact that I am right.
I have followed your message... and I have created a CStatic control in my View. It can be good !!! So I can use a derived class from CStatic in order to change all parameters... Now, I have another problem... when my View is repainted the CStatic control is drawn again (I suppose) and it blinks. How can I solve this problem ?? Thanks a lot !!!
-
I have followed your message... and I have created a CStatic control in my View. It can be good !!! So I can use a derived class from CStatic in order to change all parameters... Now, I have another problem... when my View is repainted the CStatic control is drawn again (I suppose) and it blinks. How can I solve this problem ?? Thanks a lot !!!
You have to draw it first in memory and, when it's done, you push it on the screen. Use CreateCompatibleDC to create the memory dc compatible with the screen dc. Then draw your image on this device context, and, when it's done, send it to the screen dc using the BitBlt method (bitmap copy).
-
In my SDI application I have to write some text in the View. I use TextOut function and it works fine using a Default font size and type (I suppose). I'd like to change font size and type. Is it possible ?? How ?? Thanks a lot !!!