Rank: Advanced Member
Groups: Guest
Joined: 4/26/2012(UTC) Posts: 36
Thanks: 6 times
|
Hi, Thanks for the pointer. Why is it if I use System.Drawing that the output [i.e. size] differs from when I use Aurigma.GraphicsMill. Both should be size 50pt: Code:
Dim bmp As Bitmap = New System.Drawing.Bitmap(1000, 300, System.Drawing.Imaging.PixelFormat.Format24bppRgb)
Dim graphics As System.Drawing.Graphics = graphics.FromImage(bmp)
graphics.FillRectangle(New System.Drawing.SolidBrush(System.Drawing.Color.White), 0, 0, bmp.Width, bmp.Height)
Dim font As New System.Drawing.Font("Times New Roman", 50, FontStyle.Regular, System.Drawing.GraphicsUnit.Point)
Dim text As String = "Hello World"
Dim size As System.Drawing.SizeF = graphics.MeasureString(text, font)
Dim blackBrush As System.Drawing.SolidBrush = New System.Drawing.SolidBrush(Color.Black)
graphics.DrawString(text, font, blackBrush, 0, 0)
bmp.Save("C:\Times New Roman System.bmp")
Code:
Dim bmp As Aurigma.GraphicsMill.Bitmap = New Aurigma.GraphicsMill.Bitmap(1000, 300, Aurigma.GraphicsMill.PixelFormat.Format24bppRgb)
bmp.Unit = Aurigma.GraphicsMill.Unit.Point
bmp.HorizontalResolution = 96
bmp.VerticalResolution = 96
Dim graphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = bmp.GetGdiGraphics()
graphics.FillRectangle(New Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.White), 0, 0, bmp.Width, bmp.Height)
Dim font As Aurigma.GraphicsMill.Drawing.Font = New Aurigma.GraphicsMill.Drawing.Font("Times New Roman", 50, False, False)
font.Unit = Aurigma.GraphicsMill.Unit.Point
Dim text As String = "Hello World"
Dim size As System.Drawing.SizeF = font.MeasureString(text)
Dim blackBrush As Aurigma.GraphicsMill.Drawing.SolidBrush = New Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Black)
graphics.DrawString(text, font, blackBrush, 0, 0)
bmp.Save("C:\Times New Roman Aurigma.bmp")
I note if I change the line: Code:Dim font As New System.Drawing.Font("Times New Roman", 50, FontStyle.Regular, System.Drawing.GraphicsUnit.Point)
to Code:Dim font As New System.Drawing.Font("Times New Roman", 50, FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
the font sizes are the same. How do I specify point size in Aurigma? Thanks Edited by user Monday, January 28, 2013 4:07:24 AM(UTC)
| Reason: Not specified
|