| View previous topic :: View next topic |
| Author |
Message |
necat Member
Joined: 03 Dec 2003 Posts: 4
|
Posted: 03/12/03 09:51 Post subject: Update current page in TprintPreview |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 03/12/03 10:31 Post subject: |
|
|
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 |
|
 |
necat Member
Joined: 03 Dec 2003 Posts: 4
|
Posted: 07/12/03 13:21 Post subject: |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 07/12/03 14:44 Post subject: |
|
|
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 |
|
 |
necat Member
Joined: 03 Dec 2003 Posts: 4
|
Posted: 08/12/03 13:22 Post subject: Update current page |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 08/12/03 22:28 Post subject: |
|
|
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 |
|
 |
necat Member
Joined: 03 Dec 2003 Posts: 4
|
Posted: 09/12/03 09:46 Post subject: It works. |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 235
|
Posted: 09/12/03 11:11 Post subject: |
|
|
| Currently none of these features are available. In the next release I'll include them. |
|
| Back to top |
|
 |
|