Article View: borland.public.cppbuilder.nativeapi
Article #1710ExtCreatePen & PS_GEOMETRIC & PS_USERSTYLE unit problem
From: Eyyub Volkan �ektimur
Date: Thu, 21 Jun 2007 12:16
Date: Thu, 21 Jun 2007 12:16
42 lines
2852 bytes
2852 bytes
Hi,
i'm using "ExtCreatePen" to create dashed pen style with >1 line width. as
you know to create >1 width pens , we should create geometric (PS_GEOMETRIC)
pen. To create manual styles/patterns i'm including PS_USERSTYLE also. Then
i'm defining the pattern;
------------------------------------------------------
DWORD penFlags=PS_GEOMETRIC | PS_USERSTYLE | PS_ENDCAP_FLAT | PS_JOIN_BEVEL;
LOGBRUSH lb;
DWORD userStyles[2]={30,40}; // 30unit line, 40unit space, .......
lb.lbStyle=BS_SOLID;
lb.lbColor=clBlack;
lb.lbHatch=HS_CROSS;
Canvas->Pen->Handle=ExtCreatePen(penFlags,3,&lb,2,userStyles);
------------------------------------------------------
the dash definition is 30 pixel line 40 pixel space (are they really
pixel?). In MSDN it says the unit is logical for pattern defines. I've tried
it on several printers and realized that for most of them this information
is correct. Except on one printer, it does not draw 30 pixels (when
converted to mm. -600dpi- 30pixel makes ~1.27mm). let's talk with mm. after
now.
According to pattern define values (30,40);
printer A draws 1.27 mm on paper for 30pixel, printer B draws 12.7mm for 30
pixel. Obviously there is a multiplier for printer B but i couldn't find
that.
as i said MSDN claims that pattern is in logical unit as like MoveTo,LineTo
winapi methods. I've tried to draw 30pixel length lines and 40pixel spaces,
and measured that they are 1.27mm,1.69mm space. When i've tried to create
pen with 30,40 pattern and draw a line, the output was 12.7mm line 16.9mm
space on printer B. on printer A they were all same and 1.27mm/1.69mm.
It seems like there should be a multiplier for LINE STYLE DEFINITIONS only.
i queried the map mode but it was MM_TEXT for all priners.
the question is; what is the UNIT for patterns to define pen styles ? and is
there any multiplier for it ? thanks for helping...
_______________________
Eyyub Volkan �ektimur
Proya Software Inc.
Technical Details
Message-ID:
<467a6d3e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,14963a181a9d9cb6,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII From: "Eyyub Volkan �ektimur" <evcektimur@prokon.com.tr> Newsgroups: borland.public.cppbuilder.nativeapi Subject: ExtCreatePen & PS_GEOMETRIC & PS_USERSTYLE unit problem Date: Thu, 21 Jun 2007 15:16:29 +0300 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 88.248.77.154 Message-ID: <467a6d3e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1182428478 88.248.77.154 (21 Jun 2007 05:21:18 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail