[V4RB-VServer] can't work with pictures
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Jun 10 21:31:41 CDT 2005
On 6/10/05 5:39 PM, "erne" <ernestogiannotta at tiscalinet.it> 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
So you Erne, this is that old problem? Wow.
Eric, then you can search Valentina list archive for last 3-5 years,
To find code how to use clipboard in RB to get "good" picture.
Btw, your code should work in LOCAL mode also.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list