Hello everyone,
I have a picturebox on a form which I am trying to populate with a high-quality image. I cannot just load it into the bitmap property because it is so large.
I have a little problem. If I import the file directly into a BLOB table field which I am using as the source for the picturebox, it shows. However, if I just open the form without the import, it will not show. Even if I goto the table and see that the record is there with an existing picture.
I wrote some code to try and use a second instance of the table, and force the thing to update (I thought this would be similar to an import), but it does not work, even if I UPDATE the picturebox.
Could someone look at this and tell me what I am doing wrong?
Thanks!
PictureTable.RESET;
PictureTable.SETRANGE(Description, 'Amerace Splash2');
IF PictureTable.FIND('-') THEN BEGIN
// picSplashImage is the PictureBox on the Form, it is bound to
// the currPictures.Picture BLOB field...
currPictures := PictureTable;
CurrForm.picSplashImage.UPDATE();
END ELSE BEGIN
PictureTable.INIT;
PictureTable."No." := '10000';
PictureTable.Description := 'Amerace Splash';
PictureTable.Picture.IMPORT('c:\AmeraceDB\AmeraceSplash.bmp',TRUE);
PictureTable."Last Date Modified" := TODAY;
PictureTable."Picture Type" := 'BMP';
PictureTable.INSERT;
PictureTable.MODIFY;
currPictures := PictureTable;
CurrForm.UPDATE;
END;
If I delete the record from the Picture table and reopen the form it imports and then I can see the image. But everytime after that it opens, it is a blank picturebox.
I delete it, open it again, import it again, it appears.
Thanks in advance for any help you can give!
Comments
you must use calcfields statements to show the blob fields of rec variables in a form.
hope this helps.
\:D/
No one loves you like the one who created you...