[Gambas-user] Re; Image handling ...

ron ronstk at ...239...
Fri Jul 27 00:02:46 CEST 2007


On Thursday 26 July 2007 23:36, Gareth Bult wrote:
> Ok,
> 
> I now have nifty little app for recording all my CCTV images off a variable number of camera and it's all looking great.
> 
> However, I don't know where to start with the screen flicker problem .. it did go away initially using the draw code you suggested, but it seems to have come back as a result of using a more recent SVN.
> 
> I use a separate recorder to store the images in Blobs (MySQL) and recover them with;
> 
>   File.Save(name, resultSet!image.Data)
>   $picture = Picture.Load(name)
> 
> Then issue;
> 
>   $canvas.Refresh
> 
> Then have;
> 
> PUBLIC SUB CANVAS_Draw()
>   draw.Picture($picture, 0, 0, 320, 240)  
> END
> 
> Works well, but refresh flickering is every couple of seconds and quite frustrating as it destroys viewing "quality".
> 
> Can anyone point me in the right direction re; where to look ?
> (There doesn't "seem" to be much scope for my code to cause this ???)
> 
> tia
> Gareth.
> 
> --

Once I have made something like your app in VB and a Access database 
to store the relevant information/picture.
I did not store the pictures int the database but only the filenames.
Simple because the database is a extra layer in filemanagement and that
is done much more efficient then any database engine can do.

Think at first the OS hat to determine where the database <b>files</b> are
on access request by the database engine.
Then the database engine has to look in which record the requested picture is.
then again the OS has again work to set a pointer position in the related
database files to read the sectors.
The database engine must make a temporary file to assemble with those sectors
the required picture.
Then gambas can read that file for the picture.

If it are only filenames in the database then the database does less 
bytes skipping to seek the start of the filename 
i.e. 128 bytes for filename against several hundred kilo bytes per picture.
The OS filesystem has to follow the filepointers from begin of the database file.
The database file can be spread across the disk.

Giving the OS the filename, quick found in database, the OS filesystem can
does this more efficient.

In practice it your way was for me less then 5fps.
Using the direct file access I had to implement a delay because the fps
was to high to catch the burglar, who is arrested btw.

Even add the pictures to a compressed filesystem works more efficient then
a database for this case.

Just my 2 euro cents :)

--
Ron











More information about the User mailing list