现在还不能。
CSDN开发高手第七期上,有一篇文章《变色记》可以解决你说的问题。

解决方案 »

  1.   

    Image image = null;
    Graphics g = null; StringFormat textFormat = null;
    Font textFont = null;
    Brush textBrush = null;
    Brush backBrush = null; try 
    {
    // 初始参数
    InitializeParameters(request); // 创建位图
    image = new Bitmap(_width, _height, PixelFormat.Format32bppArgb);
    g = Graphics.FromImage(image); // 创建画笔
    backBrush = new SolidBrush(_backColor);
    g.FillRectangle(backBrush, 0, 0, _width, _height); if (_text.Length != 0) 
    {
    // 创建位图内容
    textFormat = new StringFormat(StringFormatFlags.NoWrap);
    textFormat.Alignment = _horizontalAlign;
    textFormat.LineAlignment = _verticalAlign; FontStyle style = FontStyle.Regular;
    if (_bold) 
    {
    style |= FontStyle.Bold;
    }
    if (_italic) 
    {
    style |= FontStyle.Italic;
    }
    if (_underline) 
    {
    style |= FontStyle.Underline;
    }
    textFont = new Font(_fontName, (float)_fontSize, style);
    textBrush = new SolidBrush(_foreColor); //写入位图文件内容
    g.DrawString(_text, textFont, textBrush, new RectangleF(0, 0, _width, _height), textFormat);
    }
    以上是自己的一个控件的代码 希望对你有帮助。
      

  2.   

    IntPtr dc2 = Function.GetWindowDC(Function.GetDesktopWindow());  
    Function.BitBlt(dc1, 0, 0, Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height, dc2, 0, 0,13369376);  
    这两句话不对!!
      

  3.   

    gyf19(秋天的云):
      我的代码没问题, 换成4位或8位后在第一行出错, 与后面的无关.