V4RB BLOB HELP!

Jason Moehlman jmoehlma at moehlman.com
Wed Mar 12 13:06:08 CST 2003


OK I am trying your suggestion to use ReadRawData and WriteRawData.

These were the only ones I could find in the docs.  My problem is that 
they only work with a string type and I am unsure how to convert that 
into the format that the canvas control uses.

The way I was trying to do it gives me an type mismatch and I cannot 
cast a string only an object.

Ex.

         blobvalue=vcdb.Blobfield(db_images(i).name).readRawData
         tmpint=len(blobvalue)
         db_images(i).backdrop=blobvalue		// error here on type mismatch

Please help if you have an idea.

Thanks.

Jason

On Wednesday, March 12, 2003, at 03:47 AM, Ruslan Zasukhin wrote:

> on 3/12/03 2:36 AM, Jason Moehlman at jmoehlma at moehlman.com wrote:
>
>> Hello all,
>>
>> I was wondering if anyone has had any luck with BLOB jpeg fields.  The
>> last step in a conversion project from RealDB to V4RB is to get the
>> images code converted.
>>
>> Everything else has been extremely straight forward.  I have read the
>> tutorial and reference code on V4RB BLOB/Picture, but no luck.
>>
>> There are no errors during the reading or writing, the canvas object 
>> is
>> populated initially with a drag/drop event.  The image is there
>> initially but once the update takes place and the record pointer is
>> moved and the data read back there is nothing in the BLOB field.
>>
>> The included RealDB code works fine.
>>
>> The db_images() is a canvas object.  The image is a JPEG.
>>
>> rsdb is a record set, vcdb is a VCURSOR.
>>
>> RealDB writing to DB
>> rsdb.field(db_images(i).name).jpEGValue=db_images(i).backdrop
>>
>> V4RB writing to DB
>> vcdb.Blobfield(db_images(i).name).setpicture(db_images(i).backdrop)
>>
>> RealDB reading from DB
>> db_images(i).backdrop=rsdb.field(db_images(i).name).jpEGValue
>>
>> Valentina reading from DB
>> db_images(i).backdrop=vcdb.Blobfield(db_images(i).name).getpicture()
>
> Hi Jason
>
> 1) DO NOT use BLOB.SetPicture() and BLOB.GetPicture() methods.
> This are very old and to be removed methods.
>
> ----
> 2) the most correct and safe way -- to use Vpicture.SetPicture() 
> methods.
> But important to note that THIS methods require bitmpas:
>         on MAC this is PICT
>         on windows this is DIB
>
> REALbasic returns us bitmaps from its ImageWell.
>
> ---
> 3) But you say you ALREADY have correct JPG inside of Canvas ?
>
> Then you cannot use Vpicture,SetPicture(), because it self do JPG
> compression.
>
> You need then to use simply VBLOB.WriteData(), VBLOB.readData().
> Although this way is good ONLY and ONLY you are going to use this db 
> with
> YOUR RB APP. IF you plan use db with e.g. Director this will not work.
>
> In future version I need add to V4RB functions that will store READY 
> JPGs
> and GIFs and TIFFs into Picture field...
>
>
> -----
> 4) and Last.
>
>     so you do VBLOB.WriteData()
>
> But I wonder if you not forget to do
>
>     curs.AddRecord()
> Or
>     curs.UpdateRecord()
>
> Code must looks as
>
>     VBLOB.WriteData()
>     curs.UpdateRecord()
>
>
> -- 
> 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://listserv.macserve.net/mailman/listinfo/valentina
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>



More information about the Valentina mailing list