With respect to TImageEnView layers try this:
procedure TForm1.PreviewLayers1Click(Sender: TObject);
{ Print Preview Layers. }
var
iMS: TMemoryStream;
begin
{ Draw the layers to Preview1... }
ImageEnView1.LayersDrawTo(Preview1.IEBitmap);
Preview1.Update;
{ Do print preview }
if Preview1.IO.DoPrintPreviewDialog() then
begin
Preview1.Clear;
{ Restore the preview layers }
iMS := TMemoryStream.Create;
try
ImageEnView.LayersSaveToStream(iMS);
iMS.Position := 0;
Preview1.LayersLoadFromStream(iMS);
Preview1.Update;
finally
iMS.Free;
end;
end;
end;
end;
This draws the layers to a second TImageEnView (Preview1), shows the print preview dialog, then restores Preview to its original condition.
With respect to TImageEnVect try this:
procedure TForm1.PrintPreview1Click(Sender: TObject);
{ Print Preview. }
var
iMS: TMemoryStream;
begin
{ Draw the layers to ImageEnVectPreview1... also draws the objects }
ImageEnVect1.LayersDrawTo(ImageEnVectPreview1.IEBitmap);
ImageEnVectPreview1.Update;
{ Do print preview }
if ImageEnVectPreview1.IO.DoPrintPreviewDialog() then
begin
ImageEnVectPreview1.Clear;
{ Update the preview layers and objects }
iMS := TMemoryStream.Create;
try
ImageEnVect1.LayersSaveToStream(iMS);
iMS.Position := 0;
ImageEnVectPreview1.LayersLoadFromStream(iMS);
ImageEnVectPreview1.Update;
finally
iMS.Free;
end;
end;
end;
This draws the layers and objects to ImageEnVectPreview1, displays the print preview dialog, then restores the ImageEnVectPreview1 to its original condition.
Both of these work for me with the latest version. By drawing the layers and objects to another TImageEnVect the original remains unchanged.
William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html