Update current page in TprintPreview

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Update current page in TprintPreview

Postby necat » December 3rd, 2003, 9:51 am

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
necat
Member
Member
 
Posts: 4
Joined: December 3rd, 2003, 9:26 am

Postby Kambiz » December 3rd, 2003, 10:31 am

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: Select all
PrintPreview.Pages[4].Assign(HiddenPreview.Pages[0]);
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby necat » December 7th, 2003, 1:21 pm

Hi,

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

PrintPreview1 is hidden

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

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



regards,
necat
necat
Member
Member
 
Posts: 4
Joined: December 3rd, 2003, 9:26 am

Postby Kambiz » December 7th, 2003, 2:44 pm

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.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Update current page

Postby necat » December 8th, 2003, 1:22 pm

Hi,

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

Code: Select all
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
necat
Member
Member
 
Posts: 4
Joined: December 3rd, 2003, 9:26 am

Postby Kambiz » December 8th, 2003, 10:28 pm

Please download the update.

By the way, there's no need anymore to call Repaint method for both of TPrintPreview and TThumbnailView components.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

It works.

Postby necat » December 9th, 2003, 9:46 am

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
necat
Member
Member
 
Posts: 4
Joined: December 3rd, 2003, 9:26 am

Postby Kambiz » December 9th, 2003, 11:11 am

Currently none of these features are available. In the next release I'll include them.
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest

cron