| View previous topic :: View next topic |
| Author |
Message |
P_G Member
Joined: 14 Jun 2004 Posts: 25 Location: Germany
|
Posted: 19/04/05 13:35 Post subject: TSimpleGraph or TPrintPreview bug ? |
|
|
Hello again,
I noticed a strange behaviour in TPrintPreview, but I'm not sure if this is a bug.
I use the TPrintPreview as a preview for a TSimpleGraph component. To create the graphic for TPrintPreview I took the following line:
| Code: | | Mainform.SimpleGraph.Print(PrintPreview1.Canvas, Rect(0, 0, Mainform.SimpleGraph.GraphBounds.Right, (Mainform.SimpleGraph.GraphBounds.Bottom))); |
Here's the problem: I insert about 20 nodes (in line) in TSimpleGraph; each one containing a metafile. From a certain position TPrintPreview only displays the border of the nodes but not the metafiles. If I insert a bitmap instead the problem doesn't occur.
Does anyone have an idea concerning this effect?
C.U. P_G
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 430 Location: Tehran, Iran
|
Posted: 19/04/05 20:11 Post subject: |
|
|
The Print method of SimpleGraph draws the graph on the specified Canvas and in the rectangle specified by the Rect parameter. Therefore, you sould pass a rectangle on the PrintPreview page, not the bounding rectangle of the graph.
The following code is not tested but should work.
| Code: | with PrintPreview1 do
SimpleGraph.Print(Canvas, Rect(0, 0, PagePixels.X, PagePixels.Y)); |
|
|
| Back to top |
|
 |
P_G Member
Joined: 14 Jun 2004 Posts: 25 Location: Germany
|
Posted: 20/04/05 16:48 Post subject: |
|
|
Hello Kambiz,
I'm sorry but the problem occurs even with your code. And - as mentioned before - it doesn't effect nodes with simple bitmaps. That's why I thought it could be a bug, because I can't believe to have this problem by passing the wrong rect-parameters. In this case the bitmap nodes would show the same problem. BTW, nodes without graphics are always displayed in a correct way.
P_G
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 430 Location: Tehran, Iran
|
Posted: 21/04/05 18:39 Post subject: |
|
|
Hi P_G,
I dropped an instance of PrintPreview on the main form of the SimpleGraph's demo and added the following lines of code:
| Code: | procedure MainForm.PreviewGraph;
begin
PrintPreview.BeginDoc;
try
SimpleGraph.Print(PrintPreview.Canvas, PrintPreview.PageBounds);
finally
PrintPreview.EndDoc;
end;
end; |
Everything works just fine!
_________________ Kambiz |
|
| Back to top |
|
 |
P_G Member
Joined: 14 Jun 2004 Posts: 25 Location: Germany
|
Posted: 25/04/05 10:55 Post subject: |
|
|
Hi Kambiz,
Here's what I get (see attachment). I took the simplegraph demo the way you did. I added a second form for the printpreview and put about 25 metafiles on the simplegraph. The printpreview shows the metafile nodes to a certain point and then only the borders.
Don't know why...
P_G[/img]
| Description: |
|
| Filesize: |
19.01 KB |
| Viewed: |
14 Time(s) |
|
|
|
| Back to top |
|
 |
|