VPicture(VBlob) and Windows display of stored picture

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 11 23:13:58 CDT 2003


on 6/11/03 18:02, Chuck at rwc1717 at shaw.ca wrote:

> 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.

Note, on MAC, VPicture require on input PICT format picture,
And since it works for you then StringToPicture() returns it correctly.

On Windows Vpicture require DIB-format bitmap picture.
So May be you need use other function of MBS to get DIB ?


> 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?

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list