VintaSoft Annotation .NET Plug-in Discussions
Questions, comments and suggestions concerning VintaSoft Annotation .NET Plug-in.
Board index < VintaSoft Imaging < VintaSoft Annotation .NET Plug-in Discussions
Graphics g = image.GetGraphics();This operation should be called, "CreateGraphics" as the GetGraphics does exactly that (as the intellesense notes states); I was hoping I could Get the current graphics associated with Vintasoft image and perhaps use the "MeasureString()" operator for the given Graphics class.
TextAnnotation header = new TextAnnotation();
header.Text = "Test";
header.FontSizeDependsImageResolution = true;
header.Font = new Font("Arial Black", 50.0f);
float boundingBoxHeight = header.Font.Height;
float boundingBoxWidth = <???>; //How do I get the Width of the Text for the current font and loaded image?
If I can get a handle to the image's Graphics class, I could then do a Graphics.MeasureString() against the font/text. How can this be done?How can we get the Graphics class associated with a loaded arbitrary image?You can use the GetGraphics method of the VintasoftImage class.
Found a partial solution with the use of the "Font.FontSizeDependsImageResolution" attribute to get the bounding rectangle height once the font size and style is specified...Yes, the FontSizeDependsImageResolution property of the TextAnnotation class allows that font size must be scaled depending of image resolution.