#pragma once #include namespace kreslenie { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; /// /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// public __gc class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); } protected: void Dispose(Boolean disposing) { if (disposing && components) { components->Dispose(); } __super::Dispose(disposing); } private: System::Windows::Forms::PictureBox * pictureBox1; private: System::Windows::Forms::Button * button1; private: System::Windows::Forms::Button * button2; private: System::Windows::Forms::Button * button3; private: System::Windows::Forms::Button * button4; private: System::Windows::Forms::Button * button5; private: /// /// Required designer variable. /// System::ComponentModel::Container * components; /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->pictureBox1 = new System::Windows::Forms::PictureBox(); this->button1 = new System::Windows::Forms::Button(); this->button2 = new System::Windows::Forms::Button(); this->button3 = new System::Windows::Forms::Button(); this->button4 = new System::Windows::Forms::Button(); this->button5 = new System::Windows::Forms::Button(); this->SuspendLayout(); // // pictureBox1 // this->pictureBox1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle; this->pictureBox1->Location = System::Drawing::Point(16, 16); this->pictureBox1->Name = S"pictureBox1"; this->pictureBox1->Size = System::Drawing::Size(300, 300); this->pictureBox1->TabIndex = 0; this->pictureBox1->TabStop = false; this->pictureBox1->Click += new System::EventHandler(this, pictureBox1_Click); // // button1 // this->button1->Location = System::Drawing::Point(200, 392); this->button1->Name = S"button1"; this->button1->Size = System::Drawing::Size(120, 24); this->button1->TabIndex = 1; this->button1->Text = S"kresli"; this->button1->Click += new System::EventHandler(this, button1_Click_1); // // button2 // this->button2->Location = System::Drawing::Point(200, 416); this->button2->Name = S"button2"; this->button2->Size = System::Drawing::Size(176, 32); this->button2->TabIndex = 2; this->button2->Text = S"konec"; this->button2->Click += new System::EventHandler(this, button2_Click); // // button3 // this->button3->Location = System::Drawing::Point(24, 368); this->button3->Name = S"button3"; this->button3->Size = System::Drawing::Size(176, 80); this->button3->TabIndex = 3; this->button3->Text = S"dom"; this->button3->Click += new System::EventHandler(this, button3_Click); // // button4 // this->button4->Location = System::Drawing::Point(320, 392); this->button4->Name = S"button4"; this->button4->Size = System::Drawing::Size(56, 24); this->button4->TabIndex = 4; this->button4->Text = S"gradient"; this->button4->Click += new System::EventHandler(this, button4_Click); // // button5 // this->button5->Location = System::Drawing::Point(200, 368); this->button5->Name = S"button5"; this->button5->Size = System::Drawing::Size(176, 23); this->button5->TabIndex = 5; this->button5->Text = S"elektricka"; this->button5->Click += new System::EventHandler(this, button5_Click); // // Form1 // this->AutoScaleBaseSize = System::Drawing::Size(5, 13); this->ClientSize = System::Drawing::Size(416, 558); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Controls->Add(this->pictureBox1); this->Name = S"Form1"; this->Text = S"Form1"; this->Load += new System::EventHandler(this, Form1_Load); this->ResumeLayout(false); } private: System::Void pictureBox1_Click(System::Object * sender, System::EventArgs * e) { } private: System::Void button1_Click_1(System::Object * sender, System::EventArgs * e) { Graphics __gc *grafika = pictureBox1->CreateGraphics(); Pen __gc *Pero1 = new Pen(Color::Black); grafika->Clear(Color::FromArgb(255,255,255)); grafika->DrawLine(Pero1,50 ,200, 70,150); grafika->DrawLine(Pero1,70 ,150, 90,200); grafika->DrawLine(Pero1,58 ,180, 82,180); //A grafika->DrawLine(Pero1,110 ,150, 110,200); grafika->DrawLine(Pero1,140 ,150, 140,200); grafika->DrawLine(Pero1,110 ,175, 140,175); grafika->DrawArc(Pero1,160 ,150, 30,50,0,360); grafika->DrawLine(Pero1,240 ,150,240,180); /* Point body[]=new Point[3]; body[0]=Point(210,175); body[1]=Point(225,200); body[2]=Point(240,175); grafika->DrawCurve(Pero1,body);*/ grafika->DrawArc(Pero1,210 ,160,30,40,0,180); } private: System::Void button2_Click(System::Object * sender, System::EventArgs * e) { } private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e) { } private: System::Void button3_Click(System::Object * sender, System::EventArgs * e) { Graphics __gc *grafika = pictureBox1->CreateGraphics(); SolidBrush __gc *Stetec1 = new SolidBrush(Color::FromArgb(85,26,139)); SolidBrush __gc *Stetec2 = new SolidBrush(Color::Red); SolidBrush __gc *Stetec3 = new SolidBrush(Color::FromArgb(255,228,181)); grafika->Clear(Color::FromArgb(255,255,255)); grafika->FillRectangle(Stetec1,160,60,20,50); Point body[]=new Point[3]; body[0]=Point(20,140); body[1]=Point(120,50); body[2]=Point(220,140); grafika->FillPolygon(Stetec2,body); grafika->FillRectangle(Stetec3,40,140,160,150); Stetec3->set_Color(Color::FromArgb(0,255,255)); grafika->FillRectangle(Stetec3,60,150,40,60); grafika->FillRectangle(Stetec3,140,150,40,60); Pen __gc *Pero1 = new Pen(Color::Black); Point body1[]=new Point[6]; body1[0]=Point(170,55); body1[1]=Point(185,40); body1[2]=Point(210,42); body1[3]=Point(207,30); body1[4]=Point(215,25); body1[5]=Point(240,15); grafika->DrawCurve(Pero1,body1); } private: System::Void button4_Click(System::Object * sender, System::EventArgs * e) { Graphics __gc *grafika = pictureBox1->CreateGraphics(); SolidBrush __gc *Stetec1 = new SolidBrush(Color::FromArgb(0,0,0)); grafika->Clear(Color::FromArgb(255,255,255)); for(int i=0;i<=255;i++) { Stetec1->set_Color(Color::FromArgb(0,i,0)); grafika->FillRectangle(Stetec1,30+i,60,2,140); } } private: System::Void button5_Click(System::Object * sender, System::EventArgs * e) { Graphics __gc *grafika = pictureBox1->CreateGraphics(); Bitmap __gc *obrazok = new Bitmap("elektricka.jpg"); for(int i=0;i<300;i++) { grafika->Clear(Color::FromArgb(255,255,255)); grafika->DrawImage(obrazok,i,100,100,75); Sleep(500); } } }; }