Click here to Skip to main content
15,918,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralGDI: Changing pen color Pin
6-Jun-01 2:36
suss6-Jun-01 2:36 
GeneralRe: GDI: Changing pen color Pin
Tomasz Sowinski6-Jun-01 2:41
Tomasz Sowinski6-Jun-01 2:41 
GeneralRe: GDI: Changing pen color Pin
6-Jun-01 2:59
suss6-Jun-01 2:59 
GeneralRe: GDI: Changing pen color Pin
Tomasz Sowinski6-Jun-01 3:13
Tomasz Sowinski6-Jun-01 3:13 
GeneralRe: GDI: Changing pen color Pin
6-Jun-01 3:37
suss6-Jun-01 3:37 
GeneralRe: GDI: Changing pen color Pin
Tomasz Sowinski6-Jun-01 3:50
Tomasz Sowinski6-Jun-01 3:50 
GeneralRe: GDI: Changing pen color Pin
6-Jun-01 4:02
suss6-Jun-01 4:02 
GeneralRe: GDI: Changing pen color Pin
Tomasz Sowinski6-Jun-01 4:29
Tomasz Sowinski6-Jun-01 4:29 
> I don't want to do "create and delete" system, because it
> would be slow and inefficient.

Before you call something 'slow and inefficient', try to *measure* its performance. On my old 333MHz box it takes less than 120 msec to perform this:

for (int j = 0; j < 10000; j ++)
	{
		HPEN hp = CreatePen(PS_SOLID, 1, RGB(j % 255, j % 255, j % 255));
		SelectObject(hdc, hp);
		MoveToEx(hdc, j, 0, NULL);
		LineTo(hdc, j, 1);
		SelectObject(hdc, GetStockObject(NULL_PEN));
		DeleteObject(hp);
	}


It's roughly 83300 pens per second. Are you sure that pens are *real* bottleneck in your program?

Tomasz Sowinski -- http://www.shooltz.com.pl
GeneralMemory fragmentation? Pin
6-Jun-01 5:21
suss6-Jun-01 5:21 
GeneralRe: Memory fragmentation? Pin
Tomasz Sowinski6-Jun-01 5:41
Tomasz Sowinski6-Jun-01 5:41 
GeneralRe: Memory fragmentation? Pin
Pavlos Touboulidis6-Jun-01 9:06
Pavlos Touboulidis6-Jun-01 9:06 
GeneralRe: Memory fragmentation? Pin
Christian Graus6-Jun-01 9:40
protectorChristian Graus6-Jun-01 9:40 
GeneralRe: GDI: Changing pen color Pin
NormDroid6-Jun-01 3:26
professionalNormDroid6-Jun-01 3:26 
GeneralRe: GDI: Changing pen color Pin
6-Jun-01 3:52
suss6-Jun-01 3:52 
GeneralRe: GDI: Changing pen color Pin
NormDroid6-Jun-01 3:58
professionalNormDroid6-Jun-01 3:58 
GeneralRe: GDI: Changing pen color Pin
Rick York6-Jun-01 7:01
mveRick York6-Jun-01 7:01 
GeneralRe: GDI: Changing pen color Pin
Christian Graus6-Jun-01 9:43
protectorChristian Graus6-Jun-01 9:43 
GeneralRe: GDI: Changing pen color Pin
Rick York6-Jun-01 11:59
mveRick York6-Jun-01 11:59 
GeneralRe: GDI: Changing pen color Pin
Christian Graus6-Jun-01 12:47
protectorChristian Graus6-Jun-01 12:47 
GeneralRe: GDI: Changing pen color Pin
6-Jun-01 21:04
suss6-Jun-01 21:04 
GeneralRe: GDI: Changing pen color Pin
Vivek Rajan6-Jun-01 20:33
Vivek Rajan6-Jun-01 20:33 
GeneralYou convinced me guys Pin
6-Jun-01 21:35
suss6-Jun-01 21:35 
QuestionSDI to MDI ??? Pin
mr20036-Jun-01 2:21
mr20036-Jun-01 2:21 
GeneralSending Short Message Service Pin
Nagajothi6-Jun-01 1:40
Nagajothi6-Jun-01 1:40 
GeneralHTML to RTF Pin
6-Jun-01 0:22
suss6-Jun-01 0:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.