I want to draw a line on a BMP image which is engraved in a method using the method of the drill in C #
Public Zero DrawLineInt (bitmap BMP) {pen black color = new pen (color. Black, 3); Int x1 = 100; Int y1 = 100; Int x2 = 500; Int y2 = 100; // Draw the line for the screen E.Graphics.DrawLine (blackness, x1, y1, x2, y2); } This gives an error. So I want to know how to include a paint event (PaintEventArgs e)
and also want to know that the parameters How to pass when we call calling method
Drynin (bitmap BMP); This returns the following error "The name 'e' does not exist in the current context"
"To draw a line on the BMP image which is passed in the method using the method of the drill in C #"
PaintEventArgs and it will suggest that you use the "color" object For the incident Since you are calling it in some method, then you do not need to add any place.
To do this, use BFree's answer in a method.
Public Zero DrawLineInt (bitmap BMP) {pen black color = new pen (color. Black, 3); Int x1 = 100; Int y1 = 100; Int x2 = 500; Int y2 = 100; // Drawing Line for the Screen (Using Graphics = Graphics Framezes (BMP)) {graphics.DrawLine (Blackness, x1, y1, x2, y2); }} The "paint" event is picked up when the object is restored. For more information see:
Comments
Post a Comment