C
C
This thing does not rotate the text. I have tried a dozen things now,
but can't get this to rotate the text.
Public Class Form1
Dim frmImage As Bitmap = New Bitmap(1000, 800)
Dim longBmp As Bitmap = New Bitmap(250, 250)
Sub WriteAngledText(ByVal gr As Graphics, ByVal text As String,
ByVal angle As Single)
gr.RotateTransform(angle, Drawing2D.MatrixOrder.Append) ' what
is this append for?
gr.DrawString(text, Label3.Font, Brushes.BlueViolet, 200, 200)
End Sub
Private Sub Label3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Label3.Click
Dim g As Graphics = Graphics.FromImage(frmImage)
Dim glong As Graphics = Graphics.FromImage(longBmp)
Call WriteAngledText(glong, "Temperatures", 45)
' glong.DrawString("Temperature", Label1.Font,
Brushes.Blue, 10, 2)
longBmp.MakeTransparent(longBmp.GetPixel(1, 1))
' glong.RotateTransform(45,
Drawing2D.MatrixOrder.Append)
Me.Invalidate()
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.DrawImage(frmImage, 0, 0)
e.Graphics.DrawImage(longBmp, 80, 80)
End Sub
This does not show anything at all. Earlier with glong.DrawString I
could see the text "Temperature".
but can't get this to rotate the text.
Public Class Form1
Dim frmImage As Bitmap = New Bitmap(1000, 800)
Dim longBmp As Bitmap = New Bitmap(250, 250)
Sub WriteAngledText(ByVal gr As Graphics, ByVal text As String,
ByVal angle As Single)
gr.RotateTransform(angle, Drawing2D.MatrixOrder.Append) ' what
is this append for?
gr.DrawString(text, Label3.Font, Brushes.BlueViolet, 200, 200)
End Sub
Private Sub Label3_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Label3.Click
Dim g As Graphics = Graphics.FromImage(frmImage)
Dim glong As Graphics = Graphics.FromImage(longBmp)
Call WriteAngledText(glong, "Temperatures", 45)
' glong.DrawString("Temperature", Label1.Font,
Brushes.Blue, 10, 2)
longBmp.MakeTransparent(longBmp.GetPixel(1, 1))
' glong.RotateTransform(45,
Drawing2D.MatrixOrder.Append)
Me.Invalidate()
End Sub
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles Me.Paint
e.Graphics.DrawImage(frmImage, 0, 0)
e.Graphics.DrawImage(longBmp, 80, 80)
End Sub
This does not show anything at all. Earlier with glong.DrawString I
could see the text "Temperature".