Examples of MeasureCharacterRanges()


Examples of cli.System.Drawing.Graphics.MeasureCharacterRanges()

        format.set_FormatFlags( StringFormatFlags.wrap( StringFormatFlags.MeasureTrailingSpaces | StringFormatFlags.NoWrap |
                             StringFormatFlags.FitBlackBox ));
        format.set_Trimming( StringTrimming.wrap( StringTrimming.None ) );
        format.SetMeasurableCharacterRanges(new CharacterRange[] {new CharacterRange(0, 1)});
        Graphics g = createGraphics( frc );
        Region[] regions = g.MeasureCharacterRanges(String.valueOf((char)cp), font.getNetFont(),
                                                    new RectangleF(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE), format);
        SizeF size = regions[0].GetBounds(g).get_Size();
        regions[0].Dispose();
        return frc.usesFractionalMetrics() ? size.get_Width() :  Math.round(size.get_Width());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.