GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Mar-2005, 21:24
kumaran kumaran is offline
Junior Member
 
Join Date: Dec 2004
Posts: 31
kumaran is on a distinguished road

can v draw without using ondraw function


hi
is there any way to draw an object in the screen without using ondraw function.
  #2  
Old 14-Mar-2005, 22:07
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
call this function, it draws a line for you....

CPP / C++ / C Code:
void CMyDlg::DrawLine(CPoint ptFrom, CPoint ptTo, int nRedBlue)
{
	CDC *dc = this->GetDC();
	CPen pPen;
	
	pPen.CreatePen (PS_SOLID,3,RGB(255,0,0));		
	int safedc = dc->SaveDC();
	dc->SelectObject(&pPen);

	// draw the line
	dc->MoveTo (ptFrom);
	dc->LineTo (ptTo);
	
	dc->RestoreDC(safedc);
	
	pPen.DeleteObject ();
}
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
[GIM] gim.h dsmith C Programming Language 0 18-Jan-2005 08:48
Nested for loop with function Tori C++ Forum 11 08-Nov-2004 13:02
Revising Script style ?????? pepee MySQL / PHP Forum 4 14-Apr-2004 04:59

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 17:54.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.