ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
3656
3656
EMPFEHLEN
-
15.06.05 11:20 #1
- Registriert seit
- May 2005
- Beiträge
- 33
Hallo!
Ich habe folgendes Problem:
Per Paint-EventHandler will ich über die Funktion DrawBezier eine Kurve in eine PictureBox zeichnen. Leider erscheint die Kurve nicht in meiner PictureBox! Was ich mache falsch?
[CODE]
//...
private void InitializeComponent()
{
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.pictureBox1.Location = new System.Drawing.Point(64, 48);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(160, 152);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Paint += new System.Windows.Forms.PaintEventHandler(this.Paint_picBox);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(264, 246);
this.Controls.Add(this.pictureBox1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
//...
private void Paint_picBox(object sender, System.Windows.Forms.PaintEventArgs pe)
{
Pen blackPen = new Pen(Color.Black,1);
float freq_StartX = 48.0F;
float freq_StartY = 200.0F;
float dB1_X = 150.0F;
float dB1_Y = 134.0F;
float dB2_X = 170.0F;
float dB2_Y = 154.0F;
float freq_StopX = 360.0F;
float freq_StopY = 200.0F;
pe.Graphics.DrawBezier(blackPen,freq_StartX,freq_StartY,dB1_X,dB1_Y,dB2_X,dB2_Y,freq_StopX,freq_Stop Y);
}
}
Danke für Hilfe
MfG
MC
-
Hallo!
Du musst auf die Picturebox malen. Dazu dieser Code:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
' Get handle to pictureBox1. Dim hwnd As New IntPtr() hwnd = pictureBox1 ' Create new graphics object using handle to window. Dim newGraphics As Graphics = Graphics.FromHwnd(hwnd) ' Draw rectangle to screen. newGraphics.DrawRectangle(New Pen(Color.Red, 3), 0, 0, 200, 100) ' Dispose of new graphics. newGraphics.Dispose()
Weitere Infos zum zeichnen findest du in der msdn-Library im Bereich System.Drawing-Namespace in der .NET-Framework-Referenz.
Ähnliche Themen
-
Lebensdauer F-Kurve?
Von clueless_t im Forum Cinema 4DAntworten: 1Letzter Beitrag: 01.04.09, 16:19 -
Anfängerfrage: Auf eine PictureBox zeichnen? Wie?
Von u918244 im Forum .NET Grafik und SoundAntworten: 6Letzter Beitrag: 06.05.08, 18:35 -
[VB.Net] Kurve?
Von oyla12 im Forum .NET Grafik und SoundAntworten: 3Letzter Beitrag: 19.05.07, 14:55 -
pictureBox auf PictureBox oder Label
Von shn im Forum .NET Windows FormsAntworten: 1Letzter Beitrag: 31.08.05, 16:37 -
PictureBox über PictureBox
Von JK_net im Forum .NET ArchivAntworten: 1Letzter Beitrag: 14.03.05, 09:03





Zitieren
Login





