I would like to include pictures into an internal database like (Name, FirstName, Picture etc.). How can I insert pictures into such a database

Thanks for your reply

Code: Select all
domains
picture = pointer.
% @short Handle to a picture.
% @end
Code: Select all
predicates
pictToBin : (vpiDomains::picture Picture) -> binary Binary language c as runtimeLinknamesVpi::pict_ToBin.
% @short Converts the #Picture picture into the #Binary binary format.
% @detail Binary has exactly the same format as BMP file.
% @end
predicates
pictFromBin : (binary Binary) -> vpiDomains::picture Picture language c as runtimeLinknamesVpi::pict_FromBin.
% @short Retrieves the #Picture picture from the #Binary binary. <br>
% @detail Binary has exactly the same format as BMP file.
% @end
Thanks Thomas, any other way using pictures at the least possible disk space.Thomas Linder Puls wrote:OK, so the problem is saving and loading the vpiDomains::picture.
However a vpiDomains::picture is actually a pointer to "something":
If you save a pointer and load it again "another day" it will point to something different (or nothing at all).Code: Select all
domains picture = pointer. % @short Handle to a picture. % @end
You can however obtain a binary that represents the image, and that binary can be saved and loaded and reconverted into a picture (in the vpi class):
So if you let the database contain the binary-picture instead of the pointer-picture it can be saved and loaded.Code: Select all
predicates pictToBin : (vpiDomains::picture Picture) -> binary Binary language c as runtimeLinknamesVpi::pict_ToBin. % @short Converts the #Picture picture into the #Binary binary format. % @detail Binary has exactly the same format as BMP file. % @end predicates pictFromBin : (binary Binary) -> vpiDomains::picture Picture language c as runtimeLinknamesVpi::pict_FromBin. % @short Retrieves the #Picture picture from the #Binary binary. <br> % @detail Binary has exactly the same format as BMP file. % @end
(It will however use a lot of disk space)
Code: Select all
binary::compress/1->
compress : (binary Input)
-> binary Output
language c.