رسم مربع درون کنترل عکس به زبان سی شارپ
voidPictureBox_Paint(object sender,PaintEventArgs e)
{
Rectangle=newRectangle(x, y, width, height);
Pen=newPen(Color.Crimson,1);
e.Graphics.DrawRectangle(Pen,Rectangle);
}
رسم مربع درون کنترل عکس به زبان ویژوال بیسیک
Private Sub pictureBox1_Paint(sender As Object, e As PaintEventArgs)
If _painter Then
Dim rect As New Rectangle(20, 20, 40, 40)
Using pen As New Pen(Color.Blue, 2)
e.Graphics.DrawRectangle(pen, rect)
End Using
_painter = False
End If
End Sub