1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

DialogsDemo: Add scope around Graphics instance to ensure drawing is flushed to image before use

This commit is contained in:
reuk 2024-09-30 13:48:43 +01:00
parent 9cf7889422
commit 14ddfe2c22

View file

@ -515,11 +515,14 @@ private:
auto myImage = getImageFromAssets ("juce_icon.png");
Image myImage2 (Image::RGB, 500, 500, true);
Graphics g (myImage2);
g.setColour (Colours::green);
ColourGradient gradient (Colours::yellow, 170, 170, Colours::cyan, 170, 20, true);
g.setGradientFill (gradient);
g.fillEllipse (20, 20, 300, 300);
{
Graphics g (myImage2);
g.setColour (Colours::green);
ColourGradient gradient (Colours::yellow, 170, 170, Colours::cyan, 170, 20, true);
g.setGradientFill (gradient);
g.fillEllipse (20, 20, 300, 300);
}
Array<Image> images { myImage, myImage2 };