[V4RB-VServer] can't work with pictures
erne
ernestogiannotta at tiscalinet.it
Fri Jun 10 16:39:53 CDT 2005
on 10-06-2005 9:26, Eric Ferrer at wonderfef at noos.fr wrote:
> To get back to my initial problem, you told me that the way I built
> my database is OK.
> So maybe my problem comes from the way I'm adding a picture :
>
> dim cursor as VCursor
> dim thumb, pix as picture
> dim id as string
>
> id = GetUniqueID()
>
> cursor = theDatabase.SqlSelect("SELECT * FROM Pictures WHERE ID =
> '" + id + "'", 2, 1)
>
> if cursor = nil then
> MsgBox "cursor is nil"
> Return
> end if
>
> cursor.SetBlank
>
> pix = NewPicture(myPicture.Width, myPicture.Height, 32)
> pix.Graphics.DrawPicture myPicture, 0, 0
> thumb = NewPicture(32, 32, 32)
> thumb.Graphics.DrawPicture myPicture, 0, 0, 32, 32, 0, 0,
> myPicture.Width, myPicture.Height
>
Deal is Valentina accepts only Pict files on the Mac and BMP on Win
so you must convert them before feeding them to the DB
Unfortunately (and oddly) RB does not have built-in conversion tools
(MBS plugin do) so you must use workarounds:
There's old trick of putting the image created with NewPicture into the
picture prop of the Clipboard and then get it back and it will be magically
converted to a Pict
or use the SaveAsPicture method of a Folderitem and get it back again with
the OpenAsPicture method
HTH
Cool Runnings,
Erne.
--
| e r | Ernesto Giannotta
| n e | Musical Box - a media store
More information about the Valentina
mailing list