Wednesday 11 December 2013

c# GDI pattern



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace brush
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {                      
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Image img = new Bitmap(@"pattern.bmp");
            TextureBrush tb = new TextureBrush(img);
            e.Graphics.FillRectangle(tb, ClientRectangle);
        }
    }
}

No comments:

Post a Comment