[]
Provides graphics measurement information required for workbook layout calculations.
Implement this interface when you need to provide custom text measurement information for workbook layout calculations.
public interface IGraphicsInfo
Public Interface IGraphicsInfo
class CustomGraphicsInfo : IGraphicsInfo
{
public double GetDigitWidth(TextFormatInfo textFormat)
{
if ("Calibri" == textFormat.FontFamily)
{
return 8 * textFormat.FontSize / 11;
}
return 7 * textFormat.FontSize / 11;
}
}
IGraphicsInfo graphicsInfo = new CustomGraphicsInfo();
workbook.GraphicsInfo = graphicsInfo;
| Name | Description |
|---|---|
| GetDigitWidth(TextFormatInfo) | Gets the maximum width of the digits 0 through 9, in device-independent pixels. Useful formulas for wrapping a native implementation that returns pixels: [Device independent pixel] = Pixel / [DPI Scale] [DPI Scale] = DPI / 96. |