Page 1 of 1

Rendering stream

Posted: 2017-04-12T13:39:42-07:00
by barmalei
Hello,
I am new to Magick++ and would appreciate your guidance.
My goal is to render a stream on the screen, reading frames from the memory each time.
I am able to display the first image, however, I noticed once I do image.display() it just blocks there.
My question is whether I should draw the content in the same window (and run the display() in a separate thread?) or close the display window after rendering each frame?

I tried searching the board for similar questions but couldn't find any.

Thanks in advance,
Lei

Re: Rendering stream

Posted: 2017-04-12T14:29:21-07:00
by snibgo
As far as I know, image.display() can't be used to write one image after another. It uses X which I don't have so I can't test this.

It is probably fairly simple to write your own functions to (1) create a window, (2) write an image to that window (overwriting any image already there) and (3) close the window.

This is simple with Microsoft Windows, and I get effectively instantaneous changes of image. The specifics will depend on your windowing system, of course.

Re: Rendering stream

Posted: 2017-04-12T22:09:02-07:00
by barmalei
Thanks for your feedback snibgo
I am under Linux so things are not that simple, I guess :(

Re: Rendering stream

Posted: 2017-04-13T03:38:26-07:00
by snibgo
If the display program works for you, the source code in MagickWand\display.c contains code to open, write to, and destroy X windows.