vb中的Picture1.hDC
hdc对应c#里的是什么啊??

解决方案 »

  1.   

    hDC。抱歉。看错了。
    Graphics g = PictureBox1.CreateGraphics();
    g.GetHdc();
      

  2.   

    使用的时候GetHdc
    用完后释放。下次用再次获取。多少次都可以。
      

  3.   

    图片对象.Save("文件名");

    图片对象.Save("文件名",文件格式);
      

  4.   

    http://msdn.microsoft.com/zh-cn/library/ktx83wah(VS.80).aspx
      

  5.   

    如果图片是空的,那你想如何保存呢?一般是这样的。
    Bitmap bmp = new Bitmap(PictureBox1.Width,PictureBox1.Height);
    using(Graphics g = Graphics.FromImage(bmp))
    {
        //绘制
    }
    PictureBox1.Image = bmp;
    //任何时候保存都是
    PictureBox1.Image.Save("文件名");
      

  6.   

    报告失败我觉得会不会是因为Ocx
    我调用OCX之前把hdc已经传了过去之后图片自己就显示出来了
      

  7.   

    private   System.Drawing.Bitmap   bmp; 
    private   void   pictureBox1_Paint(object   sender,   System.Windows.Forms.PaintEventArgs   e) 

    Graphics   graphics   =   Graphics.FromImage(bmp); 
    Rectangle   rectangle   =   new   Rectangle(10,   10,   200,   200); 
    graphics.DrawEllipse(Pens.Black,   rectangle); 
    graphics.DrawRectangle(Pens.Red,   rectangle); 
    pictureBox1.Image=bmp; 
    pictureBox1.Image.Save( "c:\\1.bmp "); 

    IntPtr hdc = GetDC(PictureBox1.Handle);
      

  8.   


    我的不是这种情况OCX已经把画完了我只是显示出来...但是保存就不好弄了