我用了一个图片框和一个图象框写了以下代码:
picture1.print now
image1.picture=picture1.picture
但是image1的picture中并没有出现时间,请问怎么在图象框的图象上插入时间啊?

解决方案 »

  1.   

    好像是这样的,在picturebox中,自己后画上去的东东,并不在它的picture里,而在image里按你的代码来改,
    image1.picture=picture1.image
    而且要注意把autoredraw属性设为真
      

  2.   

    '在Form中添加一个PictureBox控件,Name=Picture1
    '添加一个Timer控件,Name=Timer1
    '复制以下代码到Form
    Option Explicit
    'API函数
    Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long'窗体载入
    Private Sub Form_Load()
        Picture1.AutoRedraw = True '自动重刷
        Picture1.ScaleMode = 3 'Pixel模式
        Timer1.Interval = 100 'Timer间隔
        Timer1.Enabled = True '激活
    End Sub'定时器事件
    Private Sub Timer1_Timer()
        '   左间距     顶间距
        Dim L As Long, T As Long
        '   当前时间
        Dim NTime As String
        '   清除
        Picture1.Cls
        '   时间更新
        NTime = Format(Time, "hh:mm:ss")
        '输出到Picture1
        TextOut Picture1.hdc, L, T, NTime, Len(NTime)
        '   Picture1更新
        Picture1.Refresh
    End Sub
      

  3.   

    Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As LongTextOut Picture1.hdc, 100, 100, CSTR(Now), Len(CSTR(Now))