SHARE
TWEET

Untitled

a guest Dec 12th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using System.Drawing.Drawing2D;
  11.  
  12. namespace lab9_githab
  13. {
  14.     public partial class Form1 : Form
  15.     {
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void Form1_Paint(object sender, PaintEventArgs e)
  22.         {
  23.             /* Draw circle */  
  24.             Graphics g = e.Graphics;
  25.             Pen myPen = new Pen(Color.Blue, 9);
  26.             g.DrawEllipse(myPen, 150, 150, 50, 50);
  27.  
  28.              /* Draw filled rectangle */
  29.             System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
  30.             System.Drawing.Graphics formGraphics;
  31.             formGraphics = this.CreateGraphics();
  32.             g.FillRectangle(myBrush, new Rectangle(0, 0, 50, 50));
  33.             myBrush.Dispose();
  34.            
  35.             g.Dispose();
  36.         }
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top