我是一个刚学c#的菜鸟,请教大侠们一个问题,如何用语句的方式改变背景图片的效果(比如说:拉伸,平铺等)

解决方案 »

  1.   

    拉伸        private void Form1_Paint(object sender, PaintEventArgs e)
            {
                Graphics g = e.Graphics;
                Bitmap bmp = new Bitmap(@"E:\1.jpg");
                g.DrawImage(bmp, this.ClientRectangle);   
            }
      

  2.   

    楼上的方法是其中的一种
    或者,正如RainBow_zhou所说的需要先获取背景的属性,然后再将它实用它
      

  3.   

    如是是窗体的话用Form..BackgroundImageLayout,这是一个枚举类型,其中:
    ImageLayout.Tile 平铺
    ImageLayout.Stretch 拉伸