BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Filling a polygone

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
dpap
Guest





PostPosted: Sat Aug 27, 2005 8:32 am    Post subject: Filling a polygone Reply with quote



Hi,

I try to draw a polygone with the next statements :

.......
brush.Color := TColor(Bc.AsInteger);
brush.Style := TBrushStyle(Bs.asInteger);
polygon(p);
.......
when brush.Style = bsBDiagonal or everything else except bsClear or bsNone
the draw is ok on the screen but on the printed paper the filling lines are
too near each other (allmost as I had use bsSolid). What can I do ?

I notice that specifying the brush.color after brush.style it takes allways
brush.style := bsSolid.
Is this the case ?

thanks in advance


Back to top
Peter Below (TeamB)
Guest





PostPosted: Sun Aug 28, 2005 10:14 am    Post subject: Re: Filling a polygone Reply with quote



In article <431024f4 (AT) newsgroups (DOT) borland.com>, Dpap wrote:
Quote:
I try to draw a polygone with the next statements :
.......
brush.Color := TColor(Bc.AsInteger);
brush.Style := TBrushStyle(Bs.asInteger);
polygon(p);
.......
when brush.Style = bsBDiagonal or everything else except bsClear or bsNone
the draw is ok on the screen but on the printed paper the filling lines are
too near each other (allmost as I had use bsSolid). What can I do ?

Not much, i'm afraid. The non-solid brushes are implemented as bitmap brushes
inside GDI, as far as i know. So the distance between the fill lines is fixed
as a certain number of pixels. But on the printer a "pixel" (dot) is much
smaller than on screen, since the printer has a higher resolution.

You can artificially reduce the printer.canvas resolution to the screen
resolution:

{ Scale printer to screen resolution. }
SetMapMode( printer.canvas.handle, MM_ANISOTROPIC );
SetWindowExtEx(printer.canvas.handle,
GetDeviceCaps(canvas.handle, LOGPIXELSX),
GetDeviceCaps(canvas.handle, LOGPIXELSY),
Nil);
SetViewportExtEx(printer.canvas.handle,
GetDeviceCaps(printer.canvas.handle, LOGPIXELSX),
GetDeviceCaps(printer.canvas.handle, LOGPIXELSY),
Nil);

But that will of course reduce the quality of the printout. The alternative is
to implement your own shading/filling (by drawing parallel lines with clipping
on the polygon boundaries) or perhaps your own bitmap brushes that are
designed with the printer resolution in mind.

Quote:
I notice that specifying the brush.color after brush.style it takes allways
brush.style := bsSolid.
Is this the case ?

The TBrush.SetColor method sets the style to bsSolid if it was bsClear, which
makes sense. It does not change the style if it was not bsClear. (D7)

--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.