Canvas blowing up (was Re: JavaFX Media issues)
hjohn at xs4all.nl
Fri Aug 9 20:46:22 PDT 2013
On 9/08/2013 20:15, Richard Bair wrote:
>> Also the proposed clear() or empty() option only applies to Canvas correct?
>> i.e. WritableImages don't suffer from these kind of issues and don't require such methods?
> That is correct (WritableImage we don't provide a 2D API to use to fill the buffer, you just bash the pixels yourself however you like, so we don't have to buffer anything up).
Hm, I didn't realize WritableImage had the same kind PixelWriter
interface. For my usecase, where I just render full frames to a
PixelWriter so JavaFX can display them in some fashion, why should I not
use a WriteableImage instead?
Looking at the docs, I see that one limitation is that the WritableImage
cannot be resized after construction (something that I do use with
Canvas), but I think I could work around that by just recreating the
Image when its size changes... I could just wrap a class around it that
does this transparently.
Going to take a look if I can rip out the Canvas code and replace it
with a resizable WritableImage and see what the results are for full
screen video playback...
More information about the openjfx-dev