/*★ Picture Box に画像を描画 前田 稔 ★*/ #using #using #using using namespace System; using namespace System::Windows::Forms; using namespace System::Drawing; //フォームを作成するクラス ref class FormClass : public System::Windows::Forms::Form { private: Bitmap^ img; System::Windows::Forms::PictureBox^ pictureBox1; public: //Constructor FormClass() { // pictureBox1 this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox()); this->pictureBox1->Location = System::Drawing::Point(60, 40); this->pictureBox1->Size = System::Drawing::Size(256, 256); this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::AutoSize; // Form this->Controls->Add(this->pictureBox1); this->Text = L"Pixture Box"; show(); } void show() { img = gcnew Bitmap("c:\\data\\test\\kishi.gif"); pictureBox1->Image = img; } }; //★ main() 関数 int main() { Application::Run(gcnew FormClass()); return 0; }