Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GdiPLusX Drawing on a form with scrollbars
Message
De
18/12/2007 04:42:02
 
 
À
17/12/2007 10:46:44
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01276096
Message ID:
01276427
Vues:
34
>>>>>Yes, that's exactly what I mean.
>>>>>
>>>>>After you prepare your loBMP GDI+ object, you may draw directly on the surface using the HWND Graphics.
>>>>>
>>>>>
>>>>>Something like this:
>>>>>
>>>>>
loGfx = .Graphics.FromHWND(Thisform.RealHWND) && The HWND we obtained here previously
>>>>>loGfx.DrawImage(loBmp, 0, 0) && Change it to your desired coordinates.
>>>>>
>>>>>
>>>>>
>>>>>This means that you'll create your bitmap first,and only whenfinished, it will be sent to the screen, CAPICHE ???
>>>>>
>>>>>Some people also call this as a DoubleBuffering technique.
>>>>
>>>>Hi Cesar,
>>>>
>>>>Far away from understanding any of GdiPlusX inner workings, but will sure try this.
>>>>
>>>>Thank you for all your help
>>>>Sergio
>>>
>>>
>>>This is simple to understand:
>>>
>>>When you obtain the GFX handle to draw in the Screen, every time that you use this object to draw anything, the screen will be updated, and you know that this takes some time...
>>>
>>>My other suggestion is that you create another bitmap, and do all your drawings in it. Only when you're finished drawing, you send (draw) your whole bitmap only once in the screen.
>>
>>I understood that Cesar.
>>
>>How about ImageCanvas;
>>Is this doublebuffering already implemented there or it would make difference if I created bitmap this way, and then dump it all together on surface of ImageCanvas using single call like ;
>>
>>
>>.DrawImage(loBmp, 0, 0)
>>
>>
>>Or this would be tripple-buffering :))
>
>ROFL
>
>Nope !
>The ImgCanvas already does it.
>
>It creates a Bitmap object, and everytime you send a command to the ImgCanvas.oGfx, only the offline bitmap is updated.
>
>At the end of this process, the ImgCanvas retrieves the PictureVal and updates the ImageObject. If the Canvas had to update itself on every call to the oGfx object... it would be really sloooooooow

Whoa Cesar !!
Something like that was causing me problem actually. Discovered that due to my own bug, imgcanvas was redrawn (unerlying bmp updated) twice instead of once!!
I fixed that problem and now I got completely acceptable speed with ImageCanvas! (+ better visual effect)

Speed of imgcanvas is actually excellent. It might be just 10-15% slower
then direct surface draw with double buffering (unles I planted some bug there as well <g>) while advantages are way to big to pass.
Will however use that dbl.buff aproach to speed up printing part.
So whole excersize was well worthed the effort :)

Sorry for asking all bunch of half-baked questions, but I got no any better
at this point <g>. Will hopefully have some more time to make deep dive into GdiPlusX. [ Then I am really gonna break your chops! :)) ]

Thank you for your continued patience in answering them all.
Sergio



*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform