Académique Documents
Professionnel Documents
Culture Documents
Para conocer a las personas, ve la forma como trata a sus inferiores, no a sus
iguales.
Citar
2. 26/05/2007, 14:56#2
Garfield
Senior MemberExpert@
Fecha de ingreso
18 mar, 07
Mensajes
467
Lo que sigue lo coloque en un Timer para poder obtener varias fotos por
segundo y dar la imagen de que se esta viendo un video en tiempo real de
la camara. Si quieres lo puedes colocar junto con las lneas anteriores en
un Clic de un comand que sera el encargado de capturar la foto.
'Clear ClipBoard
Clipboard.Clear
If Client Then
hDCSrc = GetDC(hWndSrc) ' Get device context for client area
Else
hDCSrc = GetWindowDC(hWndSrc) ' Get device context for entire ' window
End If
' Create a memory device context for the copy process
hDCMemory = CreateCompatibleDC(hDCSrc)
' Create a bitmap and place it in the memory DC
hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc)
hBmpPrev = SelectObject(hDCMemory, hBmp)
' Get screen properties
RasterCapsScrn = GetDeviceCaps(hDCSrc, RASTERCAPS) 'Raster 'capabilities
HasPaletteScrn = RasterCapsScrn And RC_PALETTE ' Palette 'support
PaletteSizeScrn = GetDeviceCaps(hDCSrc, SIZEPALETTE) ' Size of
' palette
'If the screen has a palette make a copy and realize it
If HasPaletteScrn And (PaletteSizeScrn = 256) Then
' Create a copy of the system palette
LogPal.palVersion = &H300
LogPal.palNumEntries = 256
r = GetSystemPaletteEntries(hDCSrc, 0, 256, LogPal.palPalEntry(0))
hPal = CreatePalette(LogPal)
' Select the new palette into the memory DC and realize it
hPalPrev = SelectPalette(hDCMemory, hPal, 0)
r = RealizePalette(hDCMemory)
End If
' Copy the on-screen image into the memory DC
r = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, LeftSrc, TopSrc,
vbSrcCopy)
' Remove the new copy of the on-screen image
hBmp = SelectObject(hDCMemory, hBmpPrev)
' If the screen has a palette get back the palette that was selected in previously
If HasPaletteScrn And (PaletteSizeScrn = 256) Then
hPal = SelectPalette(hDCMemory, hPalPrev, 0)
End If
' Release the device context resources back to the system
r = DeleteDC(hDCMemory)
r = ReleaseDC(hWndSrc, hDCSrc)
' Call CreateBitmapPicture to create a picture object from the
' bitmap and palette handles. Then return the resulting picture ' object.
Set CaptureWindow = CreateBitmapPicture(hBmp, hPal)
End Function
kortiz
Senior MemberExpert@
Fecha de ingreso
11 ene, 06
Ubicacin
Guatamala
Mensajes
438
Debo de usar a fuerzas una Camara web o hay manera de usar una camara digital
normal para esto?
Para conocer a las personas, ve la forma como trata a sus inferiores, no a sus
iguales.
Citar
4. 28/05/2007, 09:57#4
Garfield
Senior MemberExpert@
Fecha de ingreso
18 mar, 07
Mensajes
467
kortiz
Senior MemberExpert@
Fecha de ingreso
11 ene, 06
Ubicacin
Guatamala
Mensajes
438
Instale una WebCam y funciona perfecto, pero tu codigo no puedo hacer que
siquiera muestre alguna imagen el el form.
Para conocer a las personas, ve la forma como trata a sus inferiores, no a sus
iguales.
Citar
6. 29/05/2007, 11:22#6
Garfield
Senior MemberExpert@
Fecha de ingreso
18 mar, 07
Mensajes
467
Citar
7. 12/02/2009, 15:28#7
joseal15@hot
Junior MemberIniciad@
Fecha de ingreso
12 feb, 09
Ubicacin
Venezuela
Mensajes
5
Garfield
Senior MemberExpert@
Fecha de ingreso
18 mar, 07
Mensajes
467
'Clear ClipBoard
Clipboard.Clear
End Sub
If Client Then
hDCSrc = GetDC(hWndSrc) ' Get device context for client area
Else
hDCSrc = GetWindowDC(hWndSrc) ' Get device context for entire ' window
End If
' Create a memory device context for the copy process
hDCMemory = CreateCompatibleDC(hDCSrc)
' Create a bitmap and place it in the memory DC
hBmp = CreateCompatibleBitmap(hDCSrc, WidthSrc, HeightSrc)
hBmpPrev = SelectObject(hDCMemory, hBmp)
' Get screen properties
RasterCapsScrn = GetDeviceCaps(hDCSrc, RASTERCAPS) 'Raster 'capabilities
HasPaletteScrn = RasterCapsScrn And RC_PALETTE ' Palette 'support
PaletteSizeScrn = GetDeviceCaps(hDCSrc, SIZEPALETTE) ' Size of
' palette
'If the screen has a palette make a copy and realize it
If HasPaletteScrn And (PaletteSizeScrn = 256) Then
' Create a copy of the system palette
LogPal.palVersion = &H300
LogPal.palNumEntries = 256
r = GetSystemPaletteEntries(hDCSrc, 0, 256, LogPal.palPalEntry(0))
hPal = CreatePalette(LogPal)
' Select the new palette into the memory DC and realize it
hPalPrev = SelectPalette(hDCMemory, hPal, 0)
r = RealizePalette(hDCMemory)
End If
' Copy the on-screen image into the memory DC
r = BitBlt(hDCMemory, 0, 0, WidthSrc, HeightSrc, hDCSrc, LeftSrc, TopSrc,
vbSrcCopy)
' Remove the new copy of the on-screen image
hBmp = SelectObject(hDCMemory, hBmpPrev)
' If the screen has a palette get back the palette that was selected in
previously
If HasPaletteScrn And (PaletteSizeScrn = 256) Then
hPal = SelectPalette(hDCMemory, hPalPrev, 0)
End If
' Release the device context resources back to the system
r = DeleteDC(hDCMemory)
r = ReleaseDC(hWndSrc, hDCSrc)
' Call CreateBitmapPicture to create a picture object from the
' bitmap and palette handles. Then return the resulting picture ' object.
Set CaptureWindow = CreateBitmapPicture(hBmp, hPal)
End Function
Para que puedas capturar tienes que darle un click (slo uno) al botn1 , este
conecta la camara.
cada vez que presiones el botn 2, la cmara tomara una foto y la colocara en el
picturebox
Citar
9. 13/02/2009, 10:00#9
joseal15@hot
Junior MemberIniciad@
Fecha de ingreso
12 feb, 09
Ubicacin
Venezuela
Mensajes
5
Oye hermano de verdad muchas gracias esto funciona de mil maravillas le estoy
inmensamente agradecido
Citar
10. 13/02/2009, 13:12#10
joseal15@hot
Junior MemberIniciad@
Fecha de ingreso
12 feb, 09
Ubicacin
Venezuela
Mensajes
5
Garfield
Senior MemberExpert@
Fecha de ingreso
18 mar, 07
Mensajes
467
pacoalejo
Junior MemberIniciad@
Fecha de ingreso
16 abr, 09
Mensajes
1
que tal he utilizado tu codigo que es bastante bueno, pero tengo problemas pongo
el timer y si me da la imagen en tiempo real, capturo imagen y me hace todo el
proceso, pero cuando quiero salir de la aplicacion se queda ciclada y solamente
dando de baja el proceso puedo salir de ella, y me cierra el vb completo y manda el
msg que si deseo enviar el error, no se si me falte cargar alguna libreria o tenga
mal alguna rutina.
gracias
Sursum Corda
Citar
13. 20/11/2012, 19:49#13
flakiztrukizz
Junior MemberIniciad@
Fecha de ingreso
20 nov, 12
Mensajes
1
oye disculpa estoy tratando de usar tu codigo
Oye estoy tratando de usar tu codigo y me marca algunos errores y me cicla el
programa qisiera saber si me puedes ayudar para ver q esta pasando la verdad me
urge mucho es para mi proyecto final de la escuela espero tu respuesta te lo
agradeceria michisimo.
Citar
14. 04/08/2015, 17:55#14
basto
Junior MemberIniciad@
Fecha de ingreso
04 ago, 15
Mensajes
1
Hola, quisiera preguntar si existe alguna manera de verificar si existe una cmara
conectada al computador?
He buscado en muchos foros y temas pero no encuentro nada concreto
Gracias.
Citar
Temas similares
1. Tomar datos de *.txt
Por jaxa en el foro Visual Basic .NET
Respuestas: 5
ltimo mensaje: 10/07/2009, 15:41
2. Obtener dimension de fotografias
Por Don_Key en el foro Visual Basic 6.0
Respuestas: 1
ltimo mensaje: 06/05/2009, 16:46
3. Manipulacion de fotografias
Por luis_karlos en el foro Visual Basic 6.0
Respuestas: 0
ltimo mensaje: 30/10/2007, 16:53
4. librerias para compara fotografias
Por luis_karlos en el foro Visual Basic 6.0
Respuestas: 0
ltimo mensaje: 08/10/2007, 12:05
5. Tomar dato de un text
Por Germany en el foro Visual Basic 6.0
Respuestas: 4
ltimo mensaje: 08/06/2007, 07:18
Permisos de publicacin
No puedes crear nuevos temas
No puedes responder temas
No puedes subir archivos adjuntos
No puedes editar tus mensajes
Archivo
Arriba
El huso horario es GMT +2. La hora actual es: 00:41.