1、Pen pen = new Pen(System.Drawing .Color.Orange,2);
Point[] points = new Point[]
{
new Point(20,60),
new Point(80,26),
new Point(100,60),
new Point(2000,60)
};
e.Graphics.DrawLines(pen,points);
这样可以的;如果不可以,你把坐标改小点,看可以吗
但是picFHR.Image是什么我不知道取出picFHR(PictureBox)的Image就是这样写的
2、用string应该可以读出来

解决方案 »

  1.   

    To:ETstudio(外星人)
    1.
    就是增加一个System.Drawing.吗?我在类前面有using引用呀?我试了,还是一样。
    我碰到的问题是我画的线超过了PictureBox的宽,想增加一个滚动条来滚动直线。private void scbFHR_Scroll(object sender, System.Windows.Forms.ScrollEventArgs e)
    {
    Graphics g = picFHR.CreateGraphics();Rectangle MyRect1 = new Rectangle(0,0,picFHR.Width,picFHR.Height-scbFHR.Height);
    Rectangle MyRect2 = new Rectangle(scbFHR.Value,0,picFHR.Width,picFHR.Height-scbFHR.Height);
    g.DrawImage(picFHR.Image,MyRect1,MyRect2,GraphicsUnit.Pixel);
    }DrawImage()方法的第一个参数Image没有值呀,就是picFHR.Image没有返回值2.
    用string读出来是乱码“F?後@”
      

  2.   

    1、把pictrueBox的SizeMode的模式设置为AutoSize看看可以吗
    我也得不到他的image
      

  3.   

    我要的不是AutoSize,我要它的Size固定。用滚动条来滚动

    救命呀
      

  4.   

    有msn吗,QQ不太方便,不好意思
    我的msn:lazy_fox#msn.com
      

  5.   

    要想得到image,必须先给image赋值
      

  6.   

    请教qiujoe(迷糊),我用下面的代码在pictureBox中画了几条直线,但pictureBox1.Imagie的值是Null,怎么把这些直线转换为Imagie?谢谢。private void pictureBox1_Paint(){
        Pen pen = new Pen(Color.Black);    Point[] points = new Point[]
    {……};
        e.Graphics.DrawLines(pen,points);
    }
      

  7.   

    看来国内的.Net水平也就这样了哎
      

  8.   

    image img = new Bitmap(100,100);
    picturebox1.image = img;这样就是赋值Graphics 对象与特定的设备上下文关联, 所以一定要先指定你在哪个设备上绘图
      

  9.   

    "private void pictureBox1_Paint(){
        Pen pen = new Pen(Color.Black);    Point[] points = new Point[]
    {……};
        e.Graphics.DrawLines(pen,points);
    }"这是重画控件
    而Image是控件容纳的图片,两者是不能等同的
      

  10.   

    Bitmap img = new Bitmap(100,100);
    Graphics g=Graphics.FromImage(img);
    Pen pen = new Pen(Color.Black);    Point[] points = new Point[]
    {……};
        g.DrawLines(pen,points);picturebox1.image = img;
      

  11.   

    bytes[] --> long --> DateTime?
      

  12.   

    to:imini(循序渐进)
    BinaryReader可以读取所需的8个字节,我就是这么干的,但是C#的DateTime好像和VB的Date类型不兼容,无法转换为日期=============================
    to:soulroom(易水之风)
    long --> DateTime?  怎么做?
    (VB是把Date类型保存为浮点数的,应该是Double-->DateTime吧)
    我用:
    Convert.ToDateTime(r.ReadDouble())
    会出错呀。
      

  13.   

    试试Convert.ToDateTime(r.ReadDouble())改为
    Convert.ToDateTime((string)r.ReadDouble())
      

  14.   

    to:polarlm(polarlm)
    (string)r.ReadDouble()
    无法将类型“double”转换为“string”如果改为r.ReadDouble().tostring
    则出错:
    未处理的“System.FormatException”类型的异常出现在 mscorlib.dll 中。
    其他信息: 该字符串未被识别为有效的 DateTime。
      

  15.   

    TO  CoolMaker() ( ):
    我 手头没有这样的文件,没有办法帮你了~~~不过如果真的是C#和VB不兼容的话,用VB.NET应该可以的(当我没说过~~~呵呵)。我前面被OWC害得不浅,最后还是用VB.NET去写代码解决问题的:(
      

  16.   

    to:qimini(循序渐进)
    你是说没有那个二进制的文件吗,可以自己做一个的
    日期值是:2000-3-31 16:23:35
    在文件中保存是:46 0D 7F DB 15 E1 E1 40
    这是VB保存的格式,我想用C#把(46 0D 7F DB 15 E1 E1 40)转换成(2000-3-31 16:23:35)还有,在C#中可以用VB.net的代码吗,怎么用?
    可以用VB 6.0的代码吗?怎么用?
      

  17.   

    就在.cs文件中可以写VB代码吗?