VPicture(VBlob) and Windows display of stored picture
Chuck
rwc1717 at shaw.ca
Wed Jun 11 11:02:44 CDT 2003
Hi:
I am using RB4.5.2 and Valentina 1.9.
Using MBS Library and Valentina I have been able to drag/drop a picture onto
a canvas....save it to a VPicture field (or VBlob).
To drop the picture...using the method....obviously the folderitem is identified
when dropped.
Sub Load(f as FolderItem)
dim s,fulltitle as String
b=f.openbinaryfile(false)
if b<>nil
s=b.read(b.length)
b.close
canvas1.backdrop=JPEGStringToPicture(s,true)
fulltitle = f.absolutepath
As I said, I dropped the jpeg file onto a canvas and use MBS as such...
dim p as picture
dim s as string
p = canvas1.backdrop
s = PictureToString(p,"jpeg",quality.value,32)
p = StringToPicture(s, fulltitle,"image/jpeg")
p can now be stored to the VPicture field with SetPicture(p,75)....
and I can retrieve it with GetPicture().
The problem is this methodology does not work on windows. Nothing gets stored
in the database.
Must I do another translation as I do when I drop the original onto the canvas for
windows. (mac doesn't need this).
In other words...will the below code remedy this?
dim p as picture
dim s as string
......
p = tDB.mA.GetPicture()
#if TargetWin32 then
s = PictureToString(p,"jpeg",quality.value,32)
p = JPEGStringToPicture(s,true)
#endif
canvas1.backdrop = p
Can someone amswer why this works on a mac only?
Thanks Chuck Cohen
More information about the Valentina
mailing list