Re: fast drawing in delphi



DoDi,
in principle your are right,
we can store the data for later processing,
so, we can evaluate the results more slowly.
That way we can evaluate another more sophisticated
and time consuming algorithms for clustering by similarity...
You're absolutely right!
I can not wait to explain that to my boss!

Actually, for data clustering with Kohonen Map
I use a Delphi multithreading component.
But if we take the off-line visualization option
then there is not problem at which speed we draw the map...
Hope my chief accept that idea...


"Hans-Peter Diettrich" <DrDiettrich@xxxxxxxxxxx> a écrit dans le message de
news: 413ff2F1co208U1@xxxxxxxxxxxxxxxxx
> Maldona8 schrieb:
> Then it might be better to store the information (hexagon colors) about
> the first few seconds, for later replay in fast or slow motion, perhaps
> for multiple times. The stored information could be presented by a
> separate "monitor" program, independently from the real-time processing in
> the other programs. Multithreading or multitasking is frequently used in
> real time applications.
>
> Otherwise, if the display really should present a real-time "movie", I'd
> paint the changes directly on the screen. It shouldn't be a problem, if
> some changes of the same hexagons are not painted?
> (Then it also might make sense to use DirectX, to write directly to the
> video memory).
>
> DoDi
>
> P.S.: Another test, now with stored hexagon bitmaps for every color:
> I could paint 9 samples per second, each of 100*100 polygons.
> Hint: Image1.Refresh must be used after each sample, to make it visible.

It sounds realy good! This is about 111 ms resolution!

> Painting to the canvas of the form, with or without double buffering,
> allows for over 20 samples per second, with some flicker. The flickering
> certainly could be suppressed, if double buffering and appropriate
> enable/disable repaints were used. I just couldn't find the property,
> should be something like LockUpdates (not in D4)?
> Other graphics cards may not flicker at all?

I found a Lock procedure that applies to GraphicalObject in the Help

procedure Lock;
Description
Blocks other execution threads from using the associated canvas until the
Unlock method is called.
Call Lock in a multithreaded application before using the graphics object in
a section of code that would not otherwise be thread-safe. Lock prevents
other cooperating threads in the application from using the associated
canvas until the Unlock method is called. Calls to Lock can be nested so
that the canvas is not unlocked until the last lock is released.
Because Lock prevents other threads from executing, it can adversely affect
performance. Do not call Lock unless there is a danger that another thread
might interfere with the drawing.
Note: Lock will do nothing unless the drawing surface sets the
OwnerCriticalSection property. TCanvas objects automatically set the
OwnerCriticalSection property when they use graphics objects.

is this Lock the LockUpdates equivalent?



.



Relevant Pages

  • Re: Multithreading
    ... I use one MDI form as initial form where I connect to server and ... I know .NET multithreading. ... This is done by using some .NET facilities which include ... Monitor::Enterto acquire the lock, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: thread autorelease pools help requested
    ... there's a link to the Multithreading Programming Topics guide. ... nothing explains what precisely lock does. ...
    (comp.sys.mac.programmer.help)
  • Rendezvous based mutithreading.
    ... > Martin Krischik wrote: ... > The only multithreading I know is the .NET lock-based multithreading. ... multithreading - I was only used to lock based multithreading from C ... Ada programming at: http://ada.krischik.com ...
    (comp.lang.cpp)
  • Rendezvous based mutithreading.
    ... > Martin Krischik wrote: ... > The only multithreading I know is the .NET lock-based multithreading. ... multithreading - I was only used to lock based multithreading from C ... Ada programming at: http://ada.krischik.com ...
    (comp.lang.ada)