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 

Update current page in TprintPreview

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


Joined: 03 Dec 2003
Posts: 4

PostPosted: 03/12/03 09:51    Post subject: Update current page in TprintPreview Reply with quote

Hi,

I am new here,
My question for TPrintPreview programmers/users.
I create 5 pages works very fine and then change
the fontsize,color etc... on page 4. is it possible
update or refresh page 4 only without creat all
pages again?

ps: sorry for my bad english.

Thanks
Necat Kutlar
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 03/12/03 10:31    Post subject: Reply with quote

Try to use use another instance of TPrintPreview (invisible) to create the 4th page, and then assign the new page to the metafile of the original one.
Code:
PrintPreview.Pages[4].Assign(HiddenPreview.Pages[0]);
Back to top
View user's profile Send e-mail Visit poster's website
necat
Member


Joined: 03 Dec 2003
Posts: 4

PostPosted: 07/12/03 13:21    Post subject: Reply with quote

Hi,

I tryed your solution, but it does not work. I dont know what I am
missing.

PrintPreview1 is hidden

Code:

PrintPreview1.BeginDoc;
UpdateImageTextPage(pictureName);
PrintPreview1.EndDoc;
PrintPreview.Pages[ PrintPreview.CurrentPage ].Assig(PrintPreview1.Pages[0]);

// update or refresh, It's no odds.



regards,
necat
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 07/12/03 14:44    Post subject: Reply with quote

The component uses an off screen image to draw the current page. So, if you change the content of the current page, you have to repaint the off screen image. For this reason, after the assignment you should call the Repaint method (for both TPrintPreview and TThumbnailView).

The Refresh and Invalidate methods do not update the off screen image.

I hope you are using v4.33 of the component.
Back to top
View user's profile Send e-mail Visit poster's website
necat
Member


Joined: 03 Dec 2003
Posts: 4

PostPosted: 08/12/03 13:22    Post subject: Update current page Reply with quote

Hi,

sorry, it does not work.
PrintPreview1 is the invisible and
I am using v4.33 of the component.

Code:

procedure TMainForm.UpdateImageOnlyPage;
var
  R: TRect;
begin
  with PrintPreview1 do
  begin
    R := PageBounds;
    with ConvertXY(150, 150, mmLoMetric, Units) do InflateRect(R, -X, -Y);

    BeginDoc;
    Image2.Picture.LoadFromFile('test.jpg');
    PaintGraphicEx(R, Image2.Picture.Graphic, True, False, True);
    EndDoc;

    PrintPreview.Pages[2].Assign(PrintPreview1.Pages[0]);

    PrintPreview.Repaint;
    ThumbnailPreview1.Repaint;
  end;
end;



regards,
necat
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 08/12/03 22:28    Post subject: Reply with quote

Please download the update.

By the way, there's no need anymore to call Repaint method for both of TPrintPreview and TThumbnailView components.
Back to top
View user's profile Send e-mail Visit poster's website
necat
Member


Joined: 03 Dec 2003
Posts: 4

PostPosted: 09/12/03 09:46    Post subject: It works. Reply with quote

Hi,

Fine, thank you very much.

in your component, I could not find any function,
about how I can delete a page or pages!

is it not possible? I need it.

regards,
necat
Back to top
View user's profile
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 235

PostPosted: 09/12/03 11:11    Post subject: Reply with quote

Currently none of these features are available. In the next release I'll include them.
Back to top
View user's profile Send e-mail Visit poster's website
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