?
Solved

Customizing a dotted CPen...

Posted on 1997-01-13
1
Medium Priority
?
707 Views
Last Modified: 2013-11-20
I want to draw a grid on my DC.  Logically, a CPen  would be used.  When I create the CPen, I use the  PS_DOT option -  This is almost correct, but I would really like to allow the dots to be further apart...  How do I do this?
0
Comment
Question by:skink
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
chedrick earned 100 total points
ID: 1300097
There are two versions of CPen::CreatePen. Use this one:
BOOL CreatePen( int nPenStyle, int nWidth, const LOGBRUSH* pLogBrush, int nStyleCount = 0, const DWORD* lpStyle = NULL );

There is also an alternate constructor that allows you to use those (very important) last two arguments.

By setting the style to PS_USERSTYLE, the last two arguments allow you to pass an array of DWORDS that contains the line characteristics (dash and space lengths). nStyleCount is the number of (DWORD) elements in the array.
This array contains the dash/space pair values respectively.

You can use GetExtLogPen(...) to get the default values of this array and modify the array values to suit you specific needs.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question