Issue in font calculation

Joined
May 31, 2007
Messages
7
Programming Experience
1-3
Hi,
I am using
---------------------
Private Function CreateFont(ByVal Name As String, ByVal Size As Double, ByVal Style As Integer, ByVal img As Image) As Font

Dim g As Graphics = Graphics.FromImage(img)
Return New Font(Font.FontFamily, Size / 72.0F * g.DpiY, Style, GraphicsUnit.Pixel, Font.GdiCharSet, Font.GdiVerticalFont)
End Function
------------------------
to create a font.
While calculting font, everytime calling the function CreateFont which takes image as paparameter. I need graphics variable (g) for resolution of the given image.
If i do itteration with font for resizing the font then the application becomes very slow due to graphics.
Can anyone suggest any other method to calculate the font without creating any issue for image resolution.

Regrads
Abhi
 
Back
Top