重画窗体皮肤,但有一点百思不得其解,图像画到右边变样(是图像前一段变到后一段),其它正常.private System.Drawing.Image Top_RightActive;
public Form1()
{
Top_RightActive = (Bitmap)rm.GetObject("Top_RightActive"); //右上角边
}
private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
//手工画窗体的各个部?
DrawTop_Right(e.Graphics);//画标题栏右边
}
private void DrawTop_Right(Graphics g) //右上角边
{
Rectangle rect = new Rectangle(0, 0, Top_RightActive.Width, Top_RightActive.Height);
Brush brush = new TextureBrush(Top_RightActive, rect);
Rectangle rect1 = new Rectangle(Width - Top_RightActive.Width, 0, Top_RightActive.Width, Top_RightActive.Height);
g.FillRectangle(brush, rect1);
}
public Form1()
{
Top_RightActive = (Bitmap)rm.GetObject("Top_RightActive"); //右上角边
}
private void Form1_Paint(object sender,System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
//手工画窗体的各个部?
DrawTop_Right(e.Graphics);//画标题栏右边
}
private void DrawTop_Right(Graphics g) //右上角边
{
Rectangle rect = new Rectangle(0, 0, Top_RightActive.Width, Top_RightActive.Height);
Brush brush = new TextureBrush(Top_RightActive, rect);
Rectangle rect1 = new Rectangle(Width - Top_RightActive.Width, 0, Top_RightActive.Width, Top_RightActive.Height);
g.FillRectangle(brush, rect1);
}
如 :g.DrawImage(Top_RightActive
,new Rectangle(this.Width-Top_RightActive.Width,0,Top_RightActive.Width,Top_RightActive.Height),
0,0,Top_RightActive.Width,Top_RightActive.Height,GraphicsUnit.Pixel);