Drawing outlined text!

How to draw text like this! Looks interesting right! Well this is done using plain window’s GDI functions, here is a function which does this! [sourcecode language=’cpp’]// Thanks to Charles Petzold! void CCanvas::DrawOutlineText( CDC& dc, const CString& Text ) {  const int RestorePoint = dc.SaveDC(); // Create new font  CFont NewFont;   NewFont.CreatePointFont( 700, TEXT( […]
Continue reading…

 

Using PS_USERSTYLE for creating funky pens!

Using ExtCreatePen and PS_USERSTYLE you can create funky styled pens instead of the old PS_DOT, PS_DASHDOT, PS_DASHDOTDOT style pens. When using PS_USERSTYLE for creating pens you’ve got specify an array of DWORD which holds dash and space length while drawing a user styled pen! I’ve created a sample application which demostrates marching ants demo, if […]
Continue reading…

 

How to rotate text using WinAPI?

Simple way to rotate a piece of text is to use a font object… Here is a sample which does this… [sourcecode language=’cpp’]void CSomeDlg::OnPaint() {     CPaintDC dc(this);  // Get existing dlg font     CFont NewFont;      LOGFONT lgFnt = { 0 };      GetFont()->GetLogFont(&lgFnt);  // Modify this existing font // // Face name is […]
Continue reading…