/*★ Image 画像を描画する 前田 稔 ★*/
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
//フォームを作成するクラス
ref class FormClass : public System::Windows::Forms::Form
{
private:
public:
//Constructor
FormClass()
{
this->ClientSize = System::Drawing::Size(640, 320);
Paint += gcnew PaintEventHandler(this, &FormClass::MyHandler);
}
void MyHandler(Object^ sender, PaintEventArgs^ e)
{
Bitmap^ img;
PointF pnt(20.0, 10.0);
Graphics^ g = e->Graphics;
img = gcnew Bitmap("c:\\data\\test\\ffx2s.jpg");
g->DrawImage(img, pnt);
}
};
//★ main() 関数
int main()
{
// メイン ウィンドウを作成して、実行します
Application::Run(gcnew FormClass());
return 0;
}
|