๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1712

Re: ExtCreatePen & PS_GEOMETRIC & PS_USERSTYLE unit problem

#1712
From: Bob Gonder
Date: Thu, 21 Jun 2007 16:53
23 lines
1741 bytes
Eyyub Volkan ๏ฟฝektimur wrote:

>DWORD userStyles[2]={30,40};    // 30unit line, 40unit space, .......

>the question is; what is the UNIT for patterns to define pen styles ? and is 
>there any multiplier for it ? thanks for helping...

Logical (pixel) Units

Check both printers using GetDeviceCaps() for this value:
LOGPIXELSX	Number of pixels per logical inch along the screen
width.

I think you will find Pixels per mm == LOGPIXELSX / 25.4

So you would want to adjust userStyles[2] according to LOGPIXELSX
or if you are drawing vertical dashed lines, you would want to set it
by LOGPIXELSY as it might be different.

You seem to want close to a 3mm dash, so
	ppmm = (LOGPIXELSX * 3 * 10) / 254;
	userStyles[0] = (ppmm * 3) / 7;
	userStyles[1] = (ppmm * 4) / 7;
Technical Details
Message-ID: <ho9l73tr720f3belu39agu7dmnjdhe8fp6@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <467a6d3e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,14963a181a9d9cb6
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: ExtCreatePen & PS_GEOMETRIC & PS_USERSTYLE unit problem
Date: Thu, 21 Jun 2007 09:53:58 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <ho9l73tr720f3belu39agu7dmnjdhe8fp6@4ax.com>
References: <467a6d3e$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 67.77.145.161
X-Trace: newsgroups.borland.com 1182444838 67.77.145.161 (21 Jun 2007 09:53:58 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail