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
 Add objects don't effect when save to files.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

adisonx

Thailand
29 Posts

Posted - Sep 02 2019 :  02:39:56  Show Profile  Reply
After migrate from ImageEn 5 to ImageEn 8
when add new objects to image I can see objects on screen,but
when save to files object don't effect on file.
(My legacy code use ImageEnVect)
Example:
int hText = this->ImageEnVect->AddNewObject(true);
this->ImageEnVect->ObjKind[hText] = iekTEXT;
this->ImageEnVect->ObjText[hText] = "Hello";

I can see text "Hello" on screen,But when save to file the text didn't show.

xequte

38175 Posts

Posted - Sep 02 2019 :  02:55:27  Show Profile  Reply
Hi

What is your saving code?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

adisonx

Thailand
29 Posts

Posted - Sep 03 2019 :  04:57:48  Show Profile  Reply
ImageEnVect->IO->SaveToFileJpeg("C:\\Test\\temp.jpg")
Go to Top of Page

xequte

38175 Posts

Posted - Sep 04 2019 :  03:25:10  Show Profile  Reply
Hi

You need to merge the objects to the background before saving. Otherwise you only save the background image:



// File | Save As...
procedure Tfmain.SaveAs1Click(Sender: TObject);
var
  filename:string;
begin
  filename:=ImageEnVect1.IO.ExecuteSaveDialog();
  if filename <> '' then
  begin
    // Store the image without vectorial objects
    ImageEnVect1.Proc.SaveUndo;
    // merge vectorial objects with the background image
    ImageEnVect1.CopyObjectsToBack(true);
    // save to disk
    ImageEnVect1.IO.SaveToFile(filename);
    // restore
    ImageEnvect1.Proc.Undo;
  end;
end;


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