Re: Pen created using ExtCreatePen fails to get selected into a metafi
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 11/21/04
- Next message: Joseph M. Newcomer: "Re: CComboBox shows edit only"
- Previous message: Joseph M. Newcomer: "Re: Com Ports"
- In reply to: George: "Pen created using ExtCreatePen fails to get selected into a metafi"
- Next in thread: George: "Re: Pen created using ExtCreatePen fails to get selected into a me"
- Reply: George: "Re: Pen created using ExtCreatePen fails to get selected into a me"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 21 Nov 2004 01:05:17 -0500
Are you sure it is a 1-pixel solid black pen you are seeing, and not a pen of width 5
pixels (which might translate to, say, 5/600ths of an inch), with very tiny dots? I've
found there are a lot of problems like this when moving to printers. Try a number like 30
when printing, just as a test. 5 is also a poor choice, because that looks good only for
one screen resolution. Generally, you want to pick values that are based on some factor of
the screen resolution or printer resolution. For example, on a 600x800 display, 5 pixels
is 5/600 of the width of the screen, but on a printer it is 5/600 of an inch, which is
pretty small. So for an 8 1/2 inch page, at 600dpi, that's a width of 5100dots, so a value
like 42 pixels would make a bit more sense, unless you are doing all the proper scaling to
get the image to appear correctly. Then it should scale the pen width accordingly.
You might find, in graphics-intensive drawing, that it makes more sense to do
SaveDC/RestoreDC (which can nest) rather than generating lots of temporary variables to
hold intermediate state.
joe
On Thu, 18 Nov 2004 01:24:03 -0800, George <George@discussions.microsoft.com> wrote:
>Hello,
> In the OnDraw() function of my ActiveX control(just drawing , I select
>a Pen as
>shown below. The constructor of CPen passes the parameters to create
>EMR_EXTCREATEPEN structure. ( ExtCreatePen also creates a similar
>structure)
>
> LOGBRUSH tmpLB;
> tmpLB.lbColor = COLORREF(RGB(0,0,0));
> tmpLB.lbStyle = BS_SOLID;
> CPen tempPen(PS_GEOMETRIC|PS_DOT, 5, &tmpLB,0,NULL);
> pOldPen = (CPen*)pdc->SelectObject(&tempPen);
> VERIFY(pOldPen);
> pdc->Ellipse(rc);
>
>On Screen, the ellipse draws correctly with dots of width 5.
>But, On printing or drawing to a metafile DC , the ellipse is drawn
>with the stockPen (BLACK,width=1,PS_SOLID). The pen appears not to get
>selected at all into a metafile DC.
>I am using winXP.
>
>I found a related article in the KB
>http://support.microsoft.com/kb/q196299/
>But, it claims that the problem is only on win95/98.
>
>Any comments?
>Thanks,
>Bipin
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Joseph M. Newcomer: "Re: CComboBox shows edit only"
- Previous message: Joseph M. Newcomer: "Re: Com Ports"
- In reply to: George: "Pen created using ExtCreatePen fails to get selected into a metafi"
- Next in thread: George: "Re: Pen created using ExtCreatePen fails to get selected into a me"
- Reply: George: "Re: Pen created using ExtCreatePen fails to get selected into a me"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|