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
 TImageEnDBVect
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

roberto

Spain
19 Posts

Posted - Oct 01 2015 :  17:51:10  Show Profile  Reply
TImageEnDbVect

how can I save all vector and background into a jpg?

Thanks

Roberto

w2m

USA
1990 Posts

Posted - Oct 01 2015 :  17:59:34  Show Profile  Reply
Although I have not tested with TImageEnDBVect, you should be able to do this by copying the objects to the image, remove all objects and save to file like TImageEnVect:
ImageEnVect1.CopyObjectsToBack(True);
ImageEnVect1.RemoveAllObjects;
ImageEnVect1.IO.SaveToFile(AFileName);

If you mean you want to save all the objects and the background image so the objects can be loaded from the file then use SaveToFileAll and LoadToFileAll:
ImageEnVect1.SaveToFileAll('myfile.all');
ImageEnVect1.LoadFromFileAll('myfile.all');

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

roberto

Spain
19 Posts

Posted - Oct 02 2015 :  10:09:23  Show Profile  Reply
basicaly what I want to do is to print it in a report (fastreport) as there is no way to so except by saving it into a jpg and then reading the jpg image from the report.
Go to Top of Page

roberto

Spain
19 Posts

Posted - Oct 02 2015 :  11:28:09  Show Profile  Reply
I guess this is the best that can be done?

procedure TFmant.btn1Click(Sender: TObject);
var V:TImageEnVect;
begin
inherited;
  // need to create a temp TImageEnVect in order not to touch the ImageEnDBVect1 that is link to a table
  v:=TImageEnVect.create(Self);
  Try
      v.Assign(ImageEnDBVect1);
      v.CopyObjectsToBack(True);
      v.RemoveAllObjects;
      v.Update;
      v.io.SaveToFile('c:\pic.jpg');
  Finally
      v.free;
  End;
end;
Go to Top of Page

xequte

39061 Posts

Posted - Oct 02 2015 :  13:49:55  Show Profile  Reply
Hi

You don't need to load and save the image to access it. After calling CopyObjectsToBack you can just assign your TImageEnVect.IEBitmap/TImageEnVect.Bitmap.

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

roberto

Spain
19 Posts

Posted - Oct 03 2015 :  04:30:01  Show Profile  Reply
Hi Nigel
I do not quite understand what you mean, loading and saving it?
I could optimize code by removing "v.RemoveAllObjects;" and "v.Update;" as I will not uses the temp "V" variable any futher
but I still need to save the image in order for fastreport to be abled to load it in the report.
Plase note that the reason to uses "V2 is not to change the ImageEnDBVect1 as is link to a table.
May I ask you if you know any third party that will allow me to uses any of your component with fastreport?

Thanks
Roberto
Go to Top of Page

xequte

39061 Posts

Posted - Oct 03 2015 :  13:35:22  Show Profile  Reply
Hi Roberto

I don't know fastreport, but i assumed it would also accept a TBitmap as an input, rather than loading from file.


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

roberto

Spain
19 Posts

Posted - Oct 03 2015 :  14:16:00  Show Profile  Reply
Hi Nigel,
I think this may be my solution it seem to be quite simple to créate a custom report component.

I do not expect you to bother with it, but I think it would enrich your tools, after all there lots of user outthere that use fastreport.
here is the link in case someone need to do it as well.

Thanks to all for the help

https://www.fast-report.com/documentation/DevMan/index.html?custom_report_components_writing.htm
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: