[V4RB] VPicture challenges

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Sep 13 09:11:24 CDT 2004


On 9/13/04 5:32 AM, "Pedro fp" <lists at pedro.Net.au> wrote:

Hi Pedro,

> Project I'm working on is an ID photo database using Valentina & I'm
> having trouble with the picture field.
> In a variety of ways, including drawing it to a canvas, I've tried
> testing that the picture object returned from theFile.openAsPicture is
> not nil, always yielding a positive result. However the picture never
> seems to go into my database.
> 
> I have a class importItem which has properties for the picture (a RB
> picture object) & the person's name. As I loop through a folder
> selected I create an array of importItem objects from any JPEG files
> found in that folder. That array is then passed to a method of the
> Valentina base object that creates the new records.
> 
> Setting a breakpoint immediately before passing the array shows that
> the picture property for all items is not nil. However the blob file of
> my database remains the same size (100 KB) both before and after the
> import. Then when I try to retrieve the pictures nil is always
> returned.
> 
> The constructor for my picture field is ...
>    fPhoto = new VPicture( "photo", 20 * 1024 )
> 
> (I have also used 1024, the default value, as the 2nd parameter)
> 
> The picture is set to the new record using ...
>    me.fPhoto.setPicture( batch( i ).photo, 80 )
> 
> (batch is the array of importItem objects)
> 
> The data is retrieved using ...
>    dRow( i ).icon = data.PictureField( "photo" ).getPicture

You have very small photos?

Otherwise how you can be sure that your array of photos will not eat the
whole RAM?

I think may be better import picture by picture?

Next, array get pictures simply from file.ReadAs... ?
Vpicture field expect PICT which you can get only if picture is on Canvas.

You can try to use other function,
It seems it is implemented in 1.x
Function which save a picture AS IS.


> Any clues to what I'm doing wrong? Or where I should look for the
> problem?

> Also, can anyone offer a guide to selecting an appropriate value for
> the segment size in the constructor of my VPicture field?

It should be close to AVERAGE size of your photos.


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