DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TSimpleGraph or TPrintPreview bug ?

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
P_G
Member


Joined: 14 Jun 2004
Posts: 25
Location: Germany

PostPosted: 19/04/05 13:35    Post subject: TSimpleGraph or TPrintPreview bug ? Reply with quote

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
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 430
Location: Tehran, Iran

PostPosted: 19/04/05 20:11    Post subject: Reply with quote

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
View user's profile Send e-mail Visit poster's website
P_G
Member


Joined: 14 Jun 2004
Posts: 25
Location: Germany

PostPosted: 20/04/05 16:48    Post subject: Reply with quote

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
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 430
Location: Tehran, Iran

PostPosted: 21/04/05 18:39    Post subject: Reply with quote

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! Confused

_________________
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
P_G
Member


Joined: 14 Jun 2004
Posts: 25
Location: Germany

PostPosted: 25/04/05 10:55    Post subject: Reply with quote

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]



previewtest.jpg
 Description:
 Filesize:  19.01 KB
 Viewed:  14 Time(s)




Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products 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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2.0.6 © 2001, 2002 phpBB Group