Problema con Picture
Publicado por Juan (5 intervenciones) el 23/10/2006 17:34:43
Hola, gente, tengo un inconveniente estoy capturando una imagen a travez de una capturadora de video, y necesito tirársela a un picture, agregarle unos textos y después guardarla en disco .bmp, pero no puedo hace que en el .bmp que se guardó en el disco se vean los textos que pongo en el picture, anteriormente un compañero de este foro me contestó el código de aquí abajo, el tema es que yo tengo que capturar 6 imágenes en 80mS y con este código se pone un poco lento, hay algo que pueda hacer con un código mas corto? Muchas gracias
meter un picture con la imagen dentro de ese picture un label transparente en donde se escribe lo que quieras y en un segundo picture captura el picture 1 con su contenido
Dim Ret As Long
Dim WindowRect As RECT
Dim WindowhWnd As Long
Dim nHeight As Long, nWidth As Long
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 Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub CaptureWindow(WindowhWnd As Long, Output As PictureBox)
Output.Cls 'Clear the picturebox
Ret = GetWindowRect(WindowhWnd, WindowRect) 'Get the windows co-ordinates
nWidth = WindowRect.Right - WindowRect.Left 'Get the windows Width
nHeight = WindowRect.Bottom - WindowRect.Top ' Get the windows height
Ret = BitBlt(Output.hDC, 0, 0, nWidth, nHeight, GetWindowDC(WindowhWnd), 0, 0, vbSrcCopy) 'Get the windows image and copy it To the Picturebox
End Sub
Private Sub Command1_Click()
CaptureWindow Picture1.hWnd, Picture2
End Sub
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
meter un picture con la imagen dentro de ese picture un label transparente en donde se escribe lo que quieras y en un segundo picture captura el picture 1 con su contenido
Dim Ret As Long
Dim WindowRect As RECT
Dim WindowhWnd As Long
Dim nHeight As Long, nWidth As Long
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 Declare Function GetWindowDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub CaptureWindow(WindowhWnd As Long, Output As PictureBox)
Output.Cls 'Clear the picturebox
Ret = GetWindowRect(WindowhWnd, WindowRect) 'Get the windows co-ordinates
nWidth = WindowRect.Right - WindowRect.Left 'Get the windows Width
nHeight = WindowRect.Bottom - WindowRect.Top ' Get the windows height
Ret = BitBlt(Output.hDC, 0, 0, nWidth, nHeight, GetWindowDC(WindowhWnd), 0, 0, vbSrcCopy) 'Get the windows image and copy it To the Picturebox
End Sub
Private Sub Command1_Click()
CaptureWindow Picture1.hWnd, Picture2
End Sub
Private Sub Text1_Change()
Label1.Caption = Text1.Text
End Sub
Valora esta pregunta


0