各位大侠,各位大哥,请帮忙:
 我在picturebox上画了一些曲线,想保存!怎么办?有一个命令是
  例如:
    savepicture picture1.picture ,"c:\wb\wb.bmp"
  但这个命令似乎是只对picturebox上曾经加载过的图片进行保存的
  可是我这儿没有加载图片,应该怎么办?
  还有,如果我想借助于drivelistbox, dirlistbox, filelistbox三个控件和一个textbox(此处为想要保存图片的文件名如wb.bmp)配合使用生成图片的保存路径和文件名(例如代声替上例中的:"c:\wb\wb.bmp"),又应该如何编程?
 在线求救,百分相送!绝对说话算数!

解决方案 »

  1.   

    savepicture pic1.image ,"C:\ww.bmp"
      

  2.   

    建议使用common dialog  box API,
    这个封装的API可以完全替代你的那三个控件的作用
      

  3.   

    如果API不熟的话,可以使用microsoft common dialog control,这个控件也可以完全替代你的那三个控件的作用。
      

  4.   

    Private Sub Command1_Click()
    CommonDialog1.DefaultExt = "*.bmp"
    CommonDialog1.Filter = "Bmp Files(*.bmp)|*.bmp|All Files(*.*)|*.*"
    CommonDialog1.ShowSave
    If Len(Trim(CommonDialog1.FileName)) > 0 Then
      SavePicture Picture1.Image, CommonDialog1.FileName
    End If
    End Sub
      

  5.   

    savepicture pic1.image ,"C:\ww.bmp"
      

  6.   

    感谢各位的热情帮助,我在picture1上的图形是这样画出来的,使用用了pset,和 line的方法,然而现在用大家提供的方法(特别用了ch21st(风尘鸟)大侠的细心全面的方法),然而我保存的只有一张干干净净的图片,而没有把图片上画好的曲线图形保存下来,不知何故,请帮助!
      

  7.   

    http://www.china-askpro.com/msg2/qa05.shtml如何将PictureBox中的图形与控件一起转换为BMP图
      

  8.   

    Private Sub Command1_Click()
        Picture1.ScaleMode = 3
        Picture1.AutoRedraw = True
        Picture1.Line (0, 0)-(100, 100), vbRed
        SavePicture Picture1.Image, "D:\TTTT.BMP"
    End Sub
      

  9.   

    问题解决感谢各位!分已给出。
    对sosan2008说:你可以这样实现:如有问题可来信探讨([email protected])
    Private Sub Command1_Click()
    Picture1.ScaleMode = 3
    Picture1.AutoRedraw = True
    CommonDialog1.DefaultExt = "*.bmp"
    CommonDialog1.Filter = "Bmp Files(*.bmp)|*.bmp|All Files(*.*)|*.*"
    CommonDialog1.ShowSave
    If Len(Trim(CommonDialog1.FileName)) > 0 Then
      SavePicture Picture1.Image, CommonDialog1.FileName
    End If
    End Sub