ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEnMView and CopyObjectsToBack
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

kandc

29 Posts

Posted - Nov 17 2014 :  12:42:15  Show Profile  Reply
Hello,

I have an MView with ImageEnVect. I have successfully found a way to save edits back to MView (for each page) using the ImagingAnnot property, however, now I need to provide a Save option when the user is done with all pages. Is the only way to do this by reloading each page into Vect and doing a CopyObjectsToBack? or is there another way directly through MView?

I don't want to copyobjectstoback until the user resaves the entire Tiff document.

Thanks,

Kevin

w2m

USA
1990 Posts

Posted - Nov 18 2014 :  19:14:35  Show Profile  Reply
I know TImageEnVect SaveToStream and LoadFromStream saves all layers but I do not know if TImageEnVect will save its objects as well. You could try that and see if it works.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

39142 Posts

Posted - Nov 19 2014 :  01:11:30  Show Profile  Reply
Hi Kevin

So to clarify, you load a multi-page TIFF into a TImageEnMView, open each of the pages in a TImageEnVect, add annotations and assign them back to the TImageEnMView.

Now you wish to save the content of the TImageEnMView back to a multi-page TIFF file with the annotations visible when you open the TIFF in other programs. Is that correct?

The ImagingAnnot property sets the "Wang" annotations property of a TIFF file, so the annotations will only be visible by other applications that also support "Wang" annotations, which is not most image viewers.

Perhaps you should "burn" the annotations into the image itself, by using:
ieVect.CopyObjectsToBack;
ieVect.RemoveAllObjects;
Then assign the ieVect.IEBitmap back to the selected image in the TImageEnMView.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

kandc

29 Posts

Posted - Nov 19 2014 :  13:22:04  Show Profile  Reply
Sorry, let me clear it up more.

I load a TImageEnMView with (for example) a 7 page Tiff, thumbnails on left, TImageEnVect in client. User adds annotations and clicks page 2. Before displaying page 2, I save the annotations to Page 1 of the MView. User skips page 2, goes to page 3, adds a few more annotations. Goes back to page 1, removes one of the annotations, etc. Have all this working.

Now the user wants to save the Tiff back to disk/blob. Now I want to burn the annotations to the image before saving. Is there a way through MView to burn the annotations, or do I have to load each page back into an ImageEnVect to burn the images to the page? I have this working too, but I am wondering if there is a more efficient method to do this?

Vect := TImageEnVect.Create (nil);
try
Index := 0;
while (Index < ImageViewThumbNails.ImageCount) do
begin
Vect.LayersClear;
Vect.Clear;

ImageViewThumbnails.CopyToIEBitmap (Index,Vect.IEBitmap);
ImageViewThumbNails.MIO.Params [Index].ImagingAnnot.CopyToTImageEnVect (Vect);

Vect.Update;
Vect.CopyObjectsToBack;
Vect.RemoveAllObjects;

ImageViewThumbNails.SetIEBitmap (Index,Vect.IEBitmap);
ImageViewThumbNails.MIO.Params [Index].ImagingAnnot.CopyFromTImageEnVect (Vect);

Inc (Index);
end;
finally
Vect.Free;
end;
Go to Top of Page

xequte

39142 Posts

Posted - Nov 20 2014 :  12:14:21  Show Profile  Reply
Hi

The only other method would be to iterate through each of the pages and then call:

http://www.imageen.com/help/TIEImagingAnnot.DrawToBitmap.html

Something like:

For Index := 0 to ImageViewThumbnails.Count - 1 do
begin
  ImageViewThumbnails.CopyToIEBitmap (Index, ABitmap);
  ImageViewThumbNails.MIO.Params [Index].ImagingAnnot.DrawToBitmap( ABitmap );
  ImageViewThumbNails.SetIEBitmap (Index, ABitmap);
end;


Though there may well be some gotchas that I didn't take into account.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: