holla was ein source.
Code:
Public Sub StartRadar()
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.SizableToolWindow
Me.ControlBox = False
Me.Height = 260
Me.Width = 290
Me.Text = MyAppName ' neuen Namen in die Titelleiste
PictureBox2.Left = 0 'Picturebox zum Zeichnen vorbereiten
PictureBox2.Top = 0
PictureBox2.Height = 241
PictureBox2.Width = 286
PictureBox2.Anchor = 15
PictureBox2.Visible = True
PictureBox2.BringToFront()
Me.Panel3Buttons.BringToFront()
PictureBox2.BackColor = System.Drawing.Color.White
NETID("") 'neuen NetIdentString bauen
MyRNClass = RadarClass 'Welcher Klasse ich jetzt angehöre
MyRNSourceClass = ADCClass 'von welcher Klasse mich Daten interessieren
MyRNSourceID = Convert.ToByte(MyStartValue)
Disconnect()
FastConnect()
'Me.PictureBox2.BackgroundImage = Global.Me.My.Resources.Resources.RadarBack
'Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Dim TempBitmap As Bitmap
If Equals(Me.PictureBox2.Image, Nothing) Then
Me.PictureBox2.Image = New Bitmap(PictureBox2.Width, PictureBox2.Height)
End If
Dim LokalDC As Graphics
LokalDC = Graphics.FromImage(Me.PictureBox2.Image)
Dim CircleLocalHighSero2 As Integer
For i As Integer = 1 To PictureBox2.Height Step 40
CircleLocalHighSero2 = ((PictureBox2.Height / 2) - (i / 2)) 'Den Zeichen-Nullpunkt zuweisen
LokalDC.DrawEllipse(New Drawing.Pen(ColorCircle), CircleLocalHighSero2, CircleLocalHighSero2, i, i)
Next
LokalDC.Dispose()
End SubPublic Sub StartRadar()
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.SizableToolWindow
Me.ControlBox = False
Me.Height = 260
Me.Width = 290
Me.Text = MyAppName ' neuen Namen in die Titelleiste
PictureBox2.Left = 0 'Picturebox zum Zeichnen vorbereiten
PictureBox2.Top = 0
PictureBox2.Height = 241
PictureBox2.Width = 286
PictureBox2.Anchor = 15
PictureBox2.Visible = True
PictureBox2.BringToFront()
Me.Panel3Buttons.BringToFront()
PictureBox2.BackColor = System.Drawing.Color.White
NETID("") 'neuen NetIdentString bauen
MyRNClass = RadarClass 'Welcher Klasse ich jetzt angehöre
MyRNSourceClass = ADCClass 'von welcher Klasse mich Daten interessieren
MyRNSourceID = Convert.ToByte(MyStartValue)
Disconnect()
FastConnect()
'Me.PictureBox2.BackgroundImage = Global.Me.My.Resources.Resources.RadarBack
'Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Dim TempBitmap As Bitmap
If Equals(Me.PictureBox2.Image, Nothing) Then
Me.PictureBox2.Image = New Bitmap(PictureBox2.Width, PictureBox2.Height)
End If
Dim LokalDC As Graphics
LokalDC = Graphics.FromImage(Me.PictureBox2.Image)
Dim CircleLocalHighSero2 As Integer
For i As Integer = 1 To PictureBox2.Height Step 40
CircleLocalHighSero2 = ((PictureBox2.Height / 2) - (i / 2)) 'Den Zeichen-Nullpunkt zuweisen
LokalDC.DrawEllipse(New Drawing.Pen(ColorCircle), CircleLocalHighSero2, CircleLocalHighSero2, i, i)
Next
LokalDC.Dispose()
End Sub
so malt man auf dem bitmap und nicht auf dem dc.
todo's für dich wenn das Fenster grösser wird altes bitmap löschen und neues anlegen. wenn die daten kommen dann auf dem bitmap zeichen nicht auf dem dc. source aus misten.
bau mal try blöcke ein damit man auch mit bekomt wenn was schief geht
Gruß
Lesezeichen