VPicture enhancements work

Chuck rwc1717 at shaw.ca
Fri Jun 13 09:45:18 CDT 2003


Hi Ruslan:
	After a good nights sleep and remembering to change the property of my field 
object to a VPicture (that is how I went dumb and couldn't get the code to work). 
instaed of a VBlob, as it had been.

To add data to aVPicture field:

dim p as Picture
dim s as String

p = canvas1.backdrop
s = PictureToJPEGString(p,100)
tDb.mA.SetBlank
tDb.mA.VPictfield.PutFormatedPict(20,s)
tDb.mA.AddRecord
tDb.Flush

To get data from a VPicture field:

dim p as Picture
dim s as String
dim res as Boolean
dim rs as VCursor

rs = Nil
rs = tDb.SQLSelect("select from picts")
res= tDb.mA.FirstRecord
s= tDb.mA.VPictfield.GetFormatedPict()

How do I check what type of image I have..can I query GetFormatedPict() to get 
type?  or must I decipher the header another way?  And if use MonkeyBread 
StringToPicture() and PictureToString()..QuickTime must be installed.

p = JPEGStringToPicture(s,true)
tDb.Flush
canavs2.backdrop = p

Otherwise it works fine....the image was dropped, stored and retrieved.

Chuck Cohen


	



More information about the Valentina mailing list