 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
dpap Guest
|
Posted: Sat Aug 27, 2005 8:32 am Post subject: Filling a polygone |
|
|
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
|
Posted: Sun Aug 28, 2005 10:14 am Post subject: Re: Filling a polygone |
|
|
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 |
|
 |
|
|
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
|
|