Dim canvas As New Bitmap(Rtext.Width, Rtext.Height) Dim g As Graphics = Graphics.FromImage(canvas) Dim bc As SolidBrush = New SolidBrush(Rtext.ForeColor) g.DrawString(drawString, fnt, bc, 0.0F, 0.0F, sf) mozi.Image = canvas
Dim oldImage As Image = mozi.Image Dim newImage As New Bitmap(oldImage.Width, oldImage.Height) Dim g As Graphics = Graphics.FromImage(canvas) Dim bc As SolidBrush = New SolidBrush(mozi.ForeColor) '★ g.DrawString(drawString, fnt, bc, 0.0F, 0.0F, sf) mozi.Image = newCanvas oldImage.Dispose() fnt.Dispose() bc.Dispose() sf.Dispose() g.Dispose()