StretchBlit

I would really like to use this windows platform specific function to draw images with. I need to flip and scale them 20-30 times a second and the built in juce ones do not appear to be accelerated.

I am looking for some guidance on how to expose/access this. Ideally I could just use the g.drawImage pattern from juce, and on windows it would end up using StretchBlit.

Thanks for any help.

dan

StretchBlt isn’t always accelerated either, you know. If you used it to draw to an offscreen image then I’m not sure how much faster it’d be than the juce version (maybe a bit, as they’ll be using mmx and stuff).

The proper way to do this would be to write your own LowLevelGraphicsContext class and use it in the image draw methods, then use a Graphics object based on this class to draw your component. All a bit messy.

Or you could do something like the opengl or quicktime components and draw a section of the window yourself in the paint routine, using ComponentPeer::addMaskedRegion to stop it getting drawn over…

This seems ok…Why is this messy?

Would the GDIPLUS context (currently commented out) help me do fast image scaling/flipping?

I just think it’d be trickier than it sounds…

The GDI+ context code is pretty out-of-date so would need fixing. It was also hopeless in terms of performance. You’d be better off finding a more optimised library like agg or pixman and use that to render directly into the juce images.