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
 Issue - line object with arrows
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

graphman

259 Posts

Posted - Apr 04 2014 :  04:46:26  Show Profile  Reply
I add a line object with arrows

After saving and opening I see line without arrows.

Why? How to fix it?

ps
I use
ImageEnIO1->Params->ImagingAnnot->CopyFromTImageEnVect(ImageEnView1);
and
ImageEnIO1->Params->ImagingAnnot->CopyToTImageEnVect(ImageEnView1);

graphman

259 Posts

Posted - Apr 05 2014 :  14:20:40  Show Profile  Reply
To create arrows I use ObjBeginShape and ObjEndShape
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 05 2014 :  15:47:50  Show Profile  Reply
If you are trying to copy objects from one ImageEnVect to another ImageEnVect then here is what you should do with pascal:
procedure TForm1.CopyTo1Click(Sender: TObject);
begin
  ImageEnVect1.CopyAllObjectsTo(ImageEnVect2);
  ImageEnVect2.Update;
end;

I do not develop with C but I believe the C code would be:

ImageEnVect1->CopyAllObjectsTo(ImageEnVect2);
ImageEnVect2->Update;


If you are saving the ImageEnView then you will loose all objects because TImageEnView does not support vectorial objects. You should show your code that saves the file as well.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page

graphman

259 Posts

Posted - Apr 05 2014 :  16:15:00  Show Profile  Reply
> If you are saving the ImageEnView then you will loose all objects because
> TImageEnView does not support vectorial objects.

Of course I use ImageEnVect

> You should show your code that saves the file as well.

ImageEnIO1->SaveToFile(...)
Go to Top of Page

graphman

259 Posts

Posted - Apr 05 2014 :  16:18:31  Show Profile  Reply
My "ImageEnView1" is TImageEnVect component.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 05 2014 :  18:13:18  Show Profile  Reply
Did you try the code I suggested?

William Miller
Go to Top of Page

graphman

259 Posts

Posted - Apr 05 2014 :  18:27:59  Show Profile  Reply
How can it help in my case?
I can save and open line objects without problems.
But after opening I don't see arrows.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 05 2014 :  19:04:29  Show Profile  Reply
Well without seeing all your actual code I can not help much. The code works just fine here, so you are doing something wrong.

I can move an object from one TImageEnvect to another TImageEnVect and save and open the objects with the arrows visible on the line, so it is not an ImageEn problem.

procedure TForm1.CopyTo1Click(Sender: TObject);
{ Copy all objects in ImageEnVect1 to ImageEnVect2 }
begin
  ImageEnVect1.CopyAllObjectsTo(ImageEnVect2);
  ImageEnVect2.Update;
end;

procedure TForm1.Save1Click(Sender: TObject);
{ Save the objects to an iev file }
begin
  if SaveDialog1.Execute then
    ImageEnVect2.SaveToFileIEV(SaveDialog1.FileName);
end;

procedure TForm1.Clear1Click(Sender: TObject);
{ Clear ImageEnVect 2 }
begin
   ImageEnVect2.Clear;
   ImageEnVect2.RemoveAllObjects;
end;

procedure TForm1.Open2Click(Sender: TObject);
{ Open iev file with ImageEnVect2 }
begin
 OpenDialog1.Filter := 'ImageEn Objects|*.IEV';
  OpenDialog1.DefaultExt := 'IEV';
  if OpenDialog1.Execute then
    ImageEnVect2.LoadFromFileIEV(OpenDialog1.FileName);
end;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page

graphman

259 Posts

Posted - Apr 06 2014 :  05:56:09  Show Profile  Reply
I save into TIFF file (SaveToFile), not SaveToFileIEV
Go to Top of Page

w2m

USA
1990 Posts

Posted - Apr 06 2014 :  16:21:00  Show Profile  Reply
Try saving the file to a tif. I am not sure if SaveToFile saves the objects, but I know tif files support objects. You could also call SaveToFileAll (*.all) which saves all layers and objects and load the LoadFromFileAll (*.all). You could also use others others like SaveToFilePNG then SaveToFileIEV with same filename
SaveToFilePNG(Mypng.png);
SaveToFile(Mypng.iev')
then reload with LoadFromFile and LoadFromFileIEV;

If you use or SaveToFileTIF with SaveObjectsToTIFF and LoadFromFileTif with LoadObjectsFromTIFF that should work as well.
// saves the background image
ImageEnVect1.IO.SaveToFile('output.tif');
// saves the objects
ImageEnVect1.SaveObjectsToTIFF('output.tif',0);

// loads the background image
ImageEnVect1.IO.LoadFromFile('output.tif');
// loads the objects
ImageEnVect1.LoadObjectsFromTIFF('output.tif',0);

If this does not work then I have no further help.

William Miller
Go to Top of Page

graphman

259 Posts

Posted - Apr 06 2014 :  16:51:14  Show Profile  Reply
I use
ImageEnVect1.IO.SaveToFile('output.tif');
and
ImageEnVect1.IO.LoadFromFile('output.tif');

I see my lines but without arrows.
Go to Top of Page

graphman

259 Posts

Posted - Apr 06 2014 :  16:57:26  Show Profile  Reply
TImageEnVect.SaveObjectsToTIFF

This method is not compatible with Wang Imaging.

I need annotations compatible with Wang Imaging.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: