VB程序员博客

VB程序开发

Private Sub Command2_Click()
If Picture1.Picture <> LoadPicture("") Then
Printer.Print Picture1.Picture
Else
MsgBox ("不能打印")
End If
Printer.EndDoc
End Sub

居然不能打印图片,请教怎么回事啊?
Picture1.Picture <> LoadPicture("") ??哈哈楼主牛啊 第一次见到这种写法的

Printer.PaintPicture Picture1.Image, (Printer.ScaleWidth - Picture1.Width) 2, 0, Picture1.Width, Picture1.Height 
Printer.EndDoc
晕…..怎么又开了一个帖路过……怎样将picturebox上的内容(包括控件)保存为图片啊 已在另帖回复了Private Sub Command2_Click()
  If Picture1.Picture <> 0 Then
    Printer.Print Picture1.Picture,0,0
  Else
    MsgBox ("不能打印")
  End If
  Printer.EndDoc
  End Sub

居然不能打印图片,请教怎么回事啊?

[/Quote]<
Picture1.autoredraw设为True<
呵呵…天知道你代码怎么写的

Picture1装载图片与text label image 随你 全部装进Picture1里面

Option Explicit '强制宣告定义变量
Private Declare Function PrintWindow Lib "user32" (ByVal Hwnd As Long, ByVal HDC As Long, ByVal nFlags As Long) As Long
Private Sub Form_Load()
  '将窗体居中显示 (屏幕宽度减去窗体的宽度)除以2 , (屏幕高度减去窗体的高度)除以2
  Me.Move (Screen.Width - Me.Width) 2, (Screen.Height - Me.Height) 2
  Picture1.AutoRedraw = True
  Picture2.AutoRedraw = True
End Sub

Private Sub Command1_Click() '将图片1 复制到 图片2
  PrintWindow Picture1.Hwnd, Picture2.HDC, 0
  SavePicture Picture2.Image, "c: t.bmp"
End Sub

标签: , ,


专题:

栏目: