最近在做用TextureBrush纹理画刷去填充斜线,还请高手帮忙解决啊

解决方案 »

  1.   


     string strShowTip  = "xxxxxxxxxx Demo";
                    Font f             = new Font(this.Font.FontFamily, 48F, FontStyle.Bold);
                    SizeF size         = e.Graphics.MeasureString(strShowTip, f);
                    TextureBrush brush = null;
                    if (this.BackgroundImage == null)
                    {
                        Bitmap bmp = new Bitmap(50, 50, PixelFormat.Format24bppRgb);
                        // 自绘一幅图片或提取现有图片
                        this.DrawShadow(Graphics.FromImage(bmp));
                        brush = new TextureBrush(bmp, WrapMode.Tile);
                    }
                    else
                    {
                        brush = new TextureBrush(this.BackgroundImage, WrapMode.Clamp);
                    }
                    e.Graphics.DrawString(strShowTip, f, Brushes.Gold, this.m_MdiClient.Width - size.Width - 21, this.m_MdiClient.Height - size.Height - 21);
                    if (this.BackgroundImage == null)
                    {
                        e.Graphics.DrawString(strShowTip, f, Brushes.SaddleBrown, this.m_MdiClient.Width - size.Width - 19, this.m_MdiClient.Height - size.Height - 19);
                    }
                    e.Graphics.DrawString(strShowTip, f, brush, this.m_MdiClient.Width - size.Width - 20, this.m_MdiClient.Height - size.Height - 20);     
      

  2.   

    请请啊,我今天也弄了点出来了,之前 有一些关于BRUSH的旋转问题,现在都解决了,谢谢你