pictures and speed

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Nov 5 09:26:06 CST 2004


On 11/5/04 12:23 AM, "Ralf Sander" <ralf at end-if.de> wrote:

> I am planning a picture database with realbasic that should provide a
> thumbnail view and made some quick tests with valentina to observe the
> best and fast way it could be done.
> 
> 1. way
> Storing all pictures in a temporary array is fast at display but slow
> on request, because all pictures need to be decompressed at once and
> also slow at sorts etc, because it needs to be refilled every time.
> Also it takes a lot of ram.
> 
> 2. way
> Storing all pictures in an array, but only the viewed at request and
> the not yet invisible in a following thread.
> Ok, but a lot of work to eleborate on the scrollbar position etc to
> create a smooth viewing experience.
> 
> 3. way
> Getting pictures from the db when they are needed (draw event):
> 
> I tried with a standard listbox and the "backgroundpaint" event:
> 
> Function CellBackgroundPaint(g As Graphics, row As Integer, column As
> Integer) As Boolean
>       dim p as Picture
>       dim b as Boolean
> 
>        if column=0 then
>           p=NewPicture(30,30,32)
>           b=mDataBase.mPerson.GoToRecID(row)
>           p.graphics.DrawPicture mDataBase.mPerson.PictFld.GetPicture,0,0
>           g.DrawPicture p,0,0,30,30
>        end
>        return true
> 
> End Function
> 
> (I need to create a new picture here, because direct drawing draws
> anywhere on the screen (bug?))
> This solution is really to slow ( scrolling ). I think, because of the
> decompressing time for the pictures.
> 
> 
> Have anyone any other idea, how I could realize this as fast as
> possible.

I wonder, do you use RB listbox ?

You mean that you read from db only N pictures which should be drawed now?
So I assume in the same time on screen can be shown 5-10-15 pictures, yes?

When you scroll down only next new picture must be read from db and shown
Yes?



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