Add another PcitrueBox named PicAux, it will be invisible. Then assuming the PictureBox that contains all the drawing and controls is named Picture1..
This will work as far as your main Picture (Picture1) is totally visible on screen when you call this, if there are hidden/overlapped parts then BitBlt won't be able to see it.Code:Private Declare Function BitBlt Lib "gdi32" _ (ByVal hDCDest As Long, ByVal XDest As Long, ByVal YDest As Long, _ ByVal nWidth As Long, ByVal nHeight As Long, ByVal hDCSrc As Long, _ ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long Private Sub Command1_Click() BitBlt PicAux.hDC, 0, 0, Picture1.ScaleWidth, Picture1.ScaleWidth, _ Picture1.hDC, 0, 0, vbSrcCopy Printer.PaintPicture PicAux.Image, 300, 300 'print at x=300 and y=300 Printer.EndDoc End Sub Private Sub Form_Load() Picture1.AutoRedraw = False Picture1.ScaleMode = vbPixels PicAux.AutoRedraw = True PicAux.ScaleMode = vbPixels PicAux.Width = Picture1.Width PicAux.Height = Picture1.Height PicAux.Visible = False End Sub




Reply With Quote