Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Customizing a dotted CPen...

Posted on 1997-01-13
1
Medium Priority
?
709 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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. …
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

618 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