Continued troubles with VPicture and V4RB
Gary Edge
valentina at panamind.com
Thu Jan 29 11:02:52 CST 2004
I've not had success saving a jpg image to a table. I've tried the
following:
dim f as folderitem
dim p as picture
dim ps as string
dim b as binaryStream
dim bool as boolean
f = GetOpenFolderitem("") -- f is a jpg file
for testing
b = f.openasbinaryFile
ps = b.read(b.length)
p = JPEGStringToPictureMBS(ps) -- Plugin by MonkeyBread
if p <> nil then
canvas1.backdrop = p -- shows
picture correctly
c.pictureField("lpicture").SetPicture(p) -- c is a pre-existing
cursor w/ readwrite access
bool = c.update -- bool
is true
end
Now when I try to retrieve the picture using:
dim p as picture
p = c.pictureField("lpicture").getpicture -- c already exists and
is correct record
p is nil.
I've also tried:
dim f as folderitem
dim p as picture
dim ps as string
f = GetOpenFolderitem("")
-- f is a jpg file for testing
p = f.openaspicture
if p <> nil then
canvas1.backdrop = p
-- shows picture correctly
ps = PictureToJPEGStringMBS(p,75)
-- Plugin
c.pictureField("lpicture").PutFormatedPict(20,ps)
-- c is a pre-existing cursor w/ readwrite access
bool = c.update
-- bool is true
end
Later calling (simplified)
Dim s as string
dim p as picture
s = c.pictureField("lpicture").getformatedPict() -- CRASH
p = JPEGStringToPictureMBS(s)
canvas1.backdrop = p
--
Best Regards,
Gary
--
More information about the Valentina
mailing list