Search:

Type: Posts; User: KevinWorkman

Search: Search took 0.11 seconds.

  1. [SOLVED] Re: Is it wrong to create BufferedImage for using FontMetrics only?

    I mean, only store it the *first* time you do the drawing. Something like this:


    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.geom.Rectangle2D;

    import...
  2. [SOLVED] Re: Is it wrong to create BufferedImage for using FontMetrics only?

    You're thinking too hard. When I said "cache", all I meant was "save the value to a variable".
  3. [SOLVED] Re: Is it wrong to create BufferedImage for using FontMetrics only?

    Can't you just cache the values the first time you paint, and then not recalculate them after that?

    This assumes that the font of the component, or the way it's being drawn, won't change.
Results 1 to 3 of 3