I am using a TadvStringGrid as a storage device. I add information and
manipulate the data in the grid and then use the built in
Grid.SaveToBinFile() and Grid.LoadFromBinFile() to save and open the
files for use.
and displaying the pictures using a TImage component.
Image1.Picture:=Grid.GetPicture(c,r);
This all works fine.
Where I am having trouble is figuring out how I can actually save the
picture in the grid so that when it is opened I can view the images
without having to reload the original images again.
I am combining several grids into 1 for saving so cell information is
transfered from the individual grids into a single grid for saving using
something like:
savegrid.cells[c,r]:=grid1.cells[c,r]; (works fine for any text etc.)
Hi Bruno, The error appears to be when I try to copy the jpg image from one grid to the other before saving. If there is no image in grid1 then an error occurs when the grid checks the image size of the image that should be in grid2. I didn't notice this as it only shows if you actually view the grid. What can I do to check the first gird's cells to see if an image exists before I use savegrid.AddPicture(c,r,Grid1.GetPicture(c,r),false,nostretch,1,Halign,Valign);
to copy the image over?
Is there a check I can use to verify the Tpicture exists in the first grid? I tried using Grid1.GetPicture(c,r).bitmap.empty but that does not work.
I ensured the error didn't exist by loading stock images in all the cells. However, even though the images appear in the save grid, they do not save with the grid.
The save and Open works if I load the images directly into the save grid but it doesn't work when I transfer the images from the first grid to the save grid. I must be using the wrong method to transfer the information into the save grid.
What is the proper way to transfer the image from one grid to another?