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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Save Annotations per layer to file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AndyColmes Posted - Jul 14 2014 : 15:29:39
I have a TImageEnVect with 2 layers and I am creating annotations per layer. I save the IEV file but it contains all the annotations. I need to be able to save the annotations to a file per layer so I can load it to create an image for each layer.

How would I do this?

Thanks in advance.

Andy
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 18 2014 : 22:19:04
Hmmm, I can't see anything wrong with the code. I'll need to investigate when I get back into the office.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
AndyColmes Posted - Jul 18 2014 : 07:26:58
Hi Nigel,

Unfortunately, the code does not work. It seems to lock up the sFilename and disallow any access to it after running the code. Can you help?

Thanks in advance.

Andy
xequte Posted - Jul 15 2014 : 13:51:13
Hi Andy

You should be able to do this as follows (untested):

procedure SaveObjectsOfLayer(sFilename: string; iLayerToSave : Integer);
var
  i: integer;
  ihobj: integer;
  fs: TFileStream;
begin
  fs := TFileStream.Create(sFilename, fmCreate);
  for i := 0 to ImageEnVect1.ObjectsCount - 1 do
  begin
    ihobj := ImageEnVect1.GetObjFromIndex(i);
    // if hobj is on the specified layer then save it
    iobjLayer := ImageEnVect1.ObjLayer[ihobj];
    if iobjLayer = iLayerToSave then
      ImageEnVect1.SaveToStreamIEV(fs, ihobj);
  end;
  fs.free;
end;



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
w2m Posted - Jul 15 2014 : 13:11:40
Hi Andy,

I do not see a method to create an image for each layer or even to access the bitmap or objects in a specific layer by specifying which layer you wish to load. I guess this is not yet possible.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
AndyColmes Posted - Jul 14 2014 : 16:29:21
Hi Bill,

Yes, I am aware of that. But is there a way to save the objects to a IEV file per layer? Right now calling SaveToFileIEV saves all the annotations from all layers to one file.
w2m Posted - Jul 14 2014 : 15:40:40
Did you anchor the objects to a layer and set the ObjLayer property for the object when you create them?

TImageEnVect.ObjAnchorToLayers
Declaration

property ObjAnchorToLayers:boolean
Description

When true (default), all objects are anchored to a layer (using ObjLayer property). Otherwise the objects are just painted over all layers.


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