|
This is my function Pic is a Picturebox on my form. --------------------------------------------------------------------------
Private Sub TxtDim(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Pic.Click
Dim TxtCreator As Graphics = Pic.CreateGraphics Dim myBrush As New Drawing2D.LinearGradientBrush(ClientRectangle, Color.Red, Color.Yellow, Drawing2D.LinearGradientMode.Horizontal) Dim myFont As New Font("Times New Roman", 24)
TxtCreator.Clear(Pic.BackColor) TxtCreator.DrawString("Look at this text!", myFont, myBrush, myRecF)
'here
End Sub --------------------------------------------------------------------------- Well, the problem is the following: 1) where I've typed "'here" I must initialize a structure that saves X, Y, Width and Length of the drawed string. 2) I must draw a rectangle with those coordinates (X, Y, Width, Length)
3) I want to create a picturebox with "hallo" print on it how could I know the width and length of the grapic text "hallo"
Is that possible?
Thanks to all |