Jump to content

save Tuniimage picture


Harry Rogers

Recommended Posts

Hi

Whats the way to save a png image file to disc from a Tuniimage that gets its image from a url?

Dragging the image to the desktop from the browser creates a png file in the desktop directory yet

the standard programmatic file and stream based methods just result in a zero length file.

e.g.

 uniimage1.picture.savetofile('afile.png')

 uniimage1.picture.graphic.savetofile('afile.png')

 uniimage1.picture.bitmap.savetofile('afile.png')

 

So far I've used an additional  TidHttp to Get the data from the same url as the Tuniimage and write it to a filestream which works fine but it would be nice to just use the one resource if possible.

 

Thanks

Link to comment
Share on other sites

  • 1 year later...

I have a Mobile Image that I create the bitmap at runtime, how can I export it (I am using an ajax event to allow stability) ?


procedure TUniServerModule.UniGUIServerModuleCreate(Sender: TObject);
begin
  EXEDir:= UniServerModule.StartPath;

...

procedure TMainmForm.PanelAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin

  if SameText(EventName, 'ExportImage') then begin
    Image.Picture.SaveToFile(UniServerModule.EXEDir+'\files\temp\tmp.png'); // CLAIMS D:\nnnn\files\temp Directory Not Found when it exists

...
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...