public Form1() { InitializeComponent(); //image를 가져오기 //image를 List에 삽입 for (int i = 0; i < puzzleSize; i++) { //string fileName = "pic_" + (char)('a' + i) + ".png"; string fileName = string.Format("pic_{0}.png", (char)('a' + i)); Image tmpI = Image.FromFile(fileName);//C:\Users\Mirim\source\repos\PuzzleWindows\PuzzleWindows\bin\Debug 에 이미지 파일을 넣어줘야함. 왜냐면 실행이 Debug에서 실행되기 때문에 리소스 파일이 Debug 안에 존재해야함 imgList.Add(tmpI); } //PuzzleGameEngine 생성 pge = new PuzzleGameEngine(); // Timer theFont = new Font("굴림", 15); theBrush = new SolidBrush(Color.Green); thePen = new Pen(Color.Red); theTick = 0; theGameTick = 0; timer1.Start(); }
public Form1() { InitializeComponent(); // image를 가져옴 // image를 list에 넣는다 for (int i = 0; i < puzzleSize; i++) { // string fileName = "pic_" + (char)('a' + i) + ".png"; string fileName = string.Format("./images/pic_{0}.png", (char)('a' + i)); // bin/debug에서 실행되므로 image폴더 또한 그 곳에 만들어줘야한다. Image tmpi = Image.FromFile(fileName); imgList.Add(tmpi); } // PuzzleGameEngine 생성 pge = new PuzzleGameEngine(); // Timer theFont = new Font("굴림", 15); theBrush = new SolidBrush(Color.Green); thePen = new Pen(Color.Red); theTick = 0; theGameTick = 0; timer1.Start(); }
public Form1() { InitializeComponent(); imgList = new List <Image>(); for (int i = 0; i < puzzleSize; i++) { string fileName = string.Format("pic_{0}.png", (char)('a' + i)); Image tmpI = Image.FromFile(fileName); imgList.Add(tmpI); } thePen = new Pen(Color.Red); theBrush = new SolidBrush(Color.Green); theFont = new Font("굴림", 15); pge = new PuzzleGameEngine(); }