CPen question

Is it possible to create a CPen using the PS_USERSTYLE style under MS Windows 9.x? I tried it but nothing appeared n the screen.

Thanks.
IraklisAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
migelConnect With a Mentor Commented:
no
this code draw 2pixels period line (i.e . . . . . . )
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

PS_USERSTYLE is supported only on Windows NT/2000/XP. I dont think, u achive that on a 9x system.

Go to following link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pens_6rse.asp

They have not listed the 9x as the supporting OS for that style.

So, better think of some other way to achive ur targets.

VinExpert
0
 
migelCommented:
Hi!
Try LineDDA for Win95+
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
IraklisAuthor Commented:
Interesting but I could not find too much information about this function. Does it work for curve lines? Could yo send a little example? I'll double the amount of points I offer.


Thank.
0
 
migelCommented:
Hi!
no it doesn`t work for curve
here is example how to draw true dotted line

struct LINEDDAPARAM
{
     HDC          hDC;
     bool     bSet;
};

static void __stdcall LineDDAProc( int x, int y, LPARAM lParam)
{
     LINEDDAPARAM *pParam = (LINEDDAPARAM*)lParam;
     if( pParam->bSet)
          SetPixelV( pParam->hDC, x, y, SYS_COLOR_LINES);
     pParam->bSet = !pParam->bSet;
}

// and how to use

{
// some drawing code...
     LINEDDAPARAM ddaParam;
     ddaParam.hDC = hDC;
     ddaParam.bSet = false;
     LineDDA(0, 0, 100, 100, LineDDAProc, (LPARAM)&ddaParam);
}
0
 
IraklisAuthor Commented:
Hmm I think this code displays a pixel every time, right?
0
 
migelCommented:
Why 'B' ????????????????
0
 
IraklisAuthor Commented:
Because it does not work for curve lines. What's the matter?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.