[Gambas-user] Image handling ...

Benoit Minisini gambas at ...1...
Thu Jul 12 22:31:20 CEST 2007


On jeudi 12 juillet 2007, Gareth Bult wrote:
> Sorry, SVN .. recompiled this week ...
>
> --
> Gareth Bult, Encryptec Limited
> Tel: 0845 25 77033, Mob: 07891 389657
> Email: gareth at ...1689...
> Statements made are at all times subject to Encryptec's Terms and
> Conditions of Business, which are available upon request.
>
> ----- Original Message -----
> From: "Benoit Minisini" <gambas at ...1...>
> To: "mailing list for gambas users" <gambas-user at lists.sourceforge.net>
> Sent: Thursday, July 12, 2007 9:15:43 AM (GMT) Europe/London
> Subject: Re: [Gambas-user] Image handling ...
>
> On jeudi 12 juillet 2007, Gareth Bult wrote:
> > Hi,
> >
> > I'm working on a CCTV application using AXIS IP cameras and I've managed
> > to display a moving video feed from the camera in a Gambas application.
> >
> > I have two questions if anyone can help;
> >
> > a. Is there any way of getting a chunk of data acquired off the network
> > into an image without doing; File.Save("/tmp/temp")
> > obj.Picture.Flush
> > obj.Picture = Picture["/tmp/temp"]
> > (i.e. directly)

Not at the moment. But you should do it this way:

DIM hPict AS Picture

File.Save("/tmp/xxxx")
hPict = Picture.Load("/tmp/xxxx")

By using "/tmp", and a tmpfs system file, you don't lose too much time writing 
a file and read it back.

> >
> > b. If I display the picture in the root of a Window, it's perfect.
> > If I display the image in a PictureBox or a Button, if flickers very
> > badly. Is there a trick to double buffering objects inside a window so
> > they don't flicker on update ?

Don't put a big picture inside a Button: the Button actually stores two 
versions of the picture you set: one normal, and one for the disabled version 
of the normal picture.

The PictureBox will flicker less if its alignment property is set to TopLeft.

But the ideal is using a DrawingArea with Cached = FALSE, and drawing the 
picture in the Draw event. Or with Cached = TRUE if your picture is not too 
big.

> >
> > (if it helps I'm running @ 5fps)

Tell me if you can do better with my advices.

Regards,

-- 
Benoit Minisini




More information about the User mailing list