Text not rendered to image


I use the Graphics object to render text to an image but nothing is drawn.

Graphics g(image);
g.setColour( Colours::red );
g.drawSingleLineText( "hello", 0, 0 );

Both images are empty.

The font looks like this:

The image looks like this:

The font is not the problem as this also does not work when I change the font to Verdana.

Am I missing a step?

Thanks for any feedback.


Until you delete or flush a Graphics object, it might not have finished rendering, so you may be saving a half-done image. Also, drawing it with its baseline at (0, 0) means it's probably off the top of your image.