اذهب إلى المحتوى
  • 0

لغة#C

An1.

السؤال

Recommended Posts

  • 0

مرحبا @An1.

هذا هو الكود و معا مرعاة أن حجم الفورم هو : (605, 539) و حجم pictureBox هوا : (501, 523).

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace Draw
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();     
            pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
        }



        private void label1_Click(object sender, EventArgs e)
        {
            using (var g = Graphics.FromImage(pictureBox1.Image))
            {
                g.FillEllipse(Brushes.Green, -20, 340, 565, 400);
                g.FillRectangle(Brushes.Gray, 180, 220, 170, 190);

                Point[] UP = new Point[] { new Point(110, 230), new Point(420, 230), new Point(265, 130) };
                g.PixelOffsetMode = PixelOffsetMode.Half;
                using (SolidBrush brush = new SolidBrush(Color.FromArgb(255, 0, 0)))
                {

                    g.FillPolygon(brush, UP);
                }

                g.FillEllipse(Brushes.Yellow, 40, 90, 100, 100);
                pictureBox1.Refresh();
            }
        }

        
    }
}

أطيب تحياتي.

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...