Topic: Storing pictures in a folder

Hello Dimitri

Best wishes for 2015 and for MVD !

A question, please :

In an apllication, when I press SAVE button and If I use this script :

Form1.DBImage1.Picture.SaveToFile('c:\myfolder\mypicture.jpg');

I guess my picture will be stored in myfolder ?

Then what will be the role of file graphics.dll ?

For the goal of this script is to avoid to get a huge application where all medias (images, sounds) are embedded in one and only one growing up file.
It's rather preferable to have distinct files for images and distinct file for sounds and so one. (More easy to transfer and more security).

Whtat's your advice upon that ?

Thansk for all

YY

Re: Storing pictures in a folder

Hello,


You can store your files in a folder automatically, just use a property of component DBFile and DBImage, Type=LinkFile
(Sets the method of work with the image, save it to the database or refer to a file.)


and CopyTo
http://myvisualdatabase.com/help_en/com … opyto.html




Here you can read about graphics.dll
http://myvisualdatabase.com/forum/viewtopic.php?id=680

Dmitry.

Re: Storing pictures in a folder

Hello Dimitri

Thanks for your reply.
It's clear.

And now what is the good syntaxe to retrieve and load from this images folder that concerning a given record
(in so called code : to load from images folder photography of Mister X in my grid (using ID of Mr X) ?

Thanks for your explanation.

YY

Re: Storing pictures in a folder

yann.yvinec

Example

procedure Form1_GridEmployees_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
     Form1.DBImage1.Clear;
     Form1.DBImage1.LoadFromDatabase('employees', 'photo', Form1.GridEmployees.dbItemID);
end;

but this code works with mode Type=LinkFile only in version 1.48beta
https://www.dropbox.com/s/6rz92s72djtmv … 8.zip?dl=0



Here you can download example:

Post's attachments

Attachment icon LoadImageFromDatabase LinkFile.zip 545.72 kb, 601 downloads since 2015-01-06 

Dmitry.