using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Week6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Random rd = new Random();//宣告亂數種子
int x, y, w, h;//(x,y)左上座標; w:寬
Point[] po = new Point[20];
Pen pe1; //畫筆顏色
Brushes br; //填滿色彩
Font fo; //文字
Image im1; //影像
Image[] im = new Image[4]; //影像陣列
//外部變數
private void Form1_Load(object sender, EventArgs e)
{
this.Width = 960;//視窗寬高
this.Height = 680;
//在視窗中央畫十字交叉的線,中央畫綠色實心矩形寬240,高160
//Color.FromArgb(透明度, 紅色(0-255), 綠色, 藍色)
pe1 = new Pen(Color.FromArgb(100, 120, 0, 240), 4);
fo = new Font("微軟正黑體", 36);
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
this.DoubleBuffered = true;
e.Graphics.DrawLine(pe1, new Point(0,this.Height/2),
new Point(this.Width, this.Height / 2));
e.Graphics.DrawLine(pe1, new Point(this.Width/2,0),
new Point(this.Width/2, this.Height));
沒有留言:
張貼留言