eramgarden Posted March 23, 2004 Posted March 23, 2004 I'm converting a TIF image to JPG and I get this error on the bold line: Public Sub IP() Dim strFileToConvert As String strFileToConvert = "C:\source1.Tif" Dim b As New Bitmap(strFileToConvert) Dim g As Graphics() Dim bold As Font = New Font("Times New Roman", 10, FontStyle.Bold) g.DrawString("This is a test", bold, Brushes.Black, 10.0F, 10.0F) b.Save(strFileToConvert + ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg) End Sub how can I add the font? I tried : Dim g As New Graphics() but that didnt work either... Thx Quote
*Experts* mutant Posted March 23, 2004 *Experts* Posted March 23, 2004 (edited) You are declaring an array of Graphics objects. Another thing is that you need to set the Graphics object to the image. Declare it like this: Dim g As Graphics = Graphics.FromImage(b) Edited March 23, 2004 by mutant Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.