Forcer le format d'une webcam !

Le
Franck
C'est un message de format MIME en plusieurs parties.

=_NextPart_000_000C_01C512B9.E4949680
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello tout le monde, voici un nouveau p'tit problme sous vb6..

J'essaie de forcer le format de ma webcam en utilisant sendmessage.

Voici ce que j'ai fait


Declare Function SendMessageAsBitMap Lib "user32" Alias "SendMessageA" =
(ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, =
ByRef lParam As BITMAPINFO) As Integer

Public Const WM_CAP_SET_VIDEOFORMAT As Long = &H42D

Public Type BITMAPINFOHEADER
biSize As Integer
biWidth As Integer
biHeight As Integer
biPlanes As Long
biBitCount As Long
biCompression As Integer
biSizeImage As Integer
biXPelsPerMeter As Integer
biYPelsPerMeter As Integer
biClrUsed As Integer
biClrImportant As Integer
End Type



Public Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors() As Integer
End Type


sub test ()
Dim bmp As BITMAPINFO

With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With

Retour = SendMessageAsBitMap(hWnd, WM_CAP_SET_VIDEOFORMAT, Len(bmp), =
bmp)

a plante ici en me disant que j'ai un dpassement de =
capacit..alors je dois tre un peu miro mais je vois pas ou ???? =
HELP

end sub



=_NextPart_000_000C_01C512B9.E4949680
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" =
http-equiv=Content-Type>
<META content="MSHTML 5.00.3819.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: "><LABEL id=HbSession
SessionId="3065071590"></LABEL>
<DIV><FONT face=Arial size=2>Hello tout le monde, voici un nouveau =
p'tit
problme sous vb6..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>J'essaie de forcer le format de ma =
webcam en
utilisant&nbsp;sendmessage.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Voici ce que j'ai fait&nbsp; =
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Declare Function SendMessageAsBitMap =
Lib "user32"
Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, =
ByVal wParam
As Integer, ByRef lParam As BITMAPINFO) As Integer</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Const WM_CAP_SET_VIDEOFORMAT As =
Long =
&amp;H42D</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Type
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSize As =

Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biWidth As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biHeight As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biPlanes As
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biBitCount As
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biCompression As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSizeImage As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biXPelsPerMeter As =

Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biYPelsPerMeter As =

Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biClrUsed As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biClrImportant As
Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Type
BITMAPINFO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmiHeader As
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bmiColors() As
Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>sub test ()</FONT></DIV>
<DIV><FONT face=Arial size=2>Dim bmp As BITMAPINFO</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; With
bmp.bmiHeader<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biSize =
Len(bmp.bmiHeader)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biWidth =
320<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biHeight =
240<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biPlanes =
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biBitCount = 24<BR>&nbsp;&nbsp; =
End
With</FONT></DIV>
<DIV><BR><FONT color=#800000 face=Arial size=2>Retour =
SendMessageAsBitMap(hWnd, WM_CAP_SET_VIDEOFORMAT, Len(bmp), =
bmp)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#800000 face=Arial size=2>a plante ici en me =
disant que j'ai
un dpassement de capacit..alors je dois tre un peu miro mais =
je vois pas
ou ???? HELP</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>end sub</FONT></DIV>
<DIV>&nbsp;</DIV>
<P></P></BODY></HTML>

=_NextPart_000_000C_01C512B9.E4949680--
  • Partager ce contenu :
Vos réponses
Trier par : date / pertinence
Franck
Le #15604111
C'est un message de format MIME en plusieurs parties.

------=_NextPart_000_0008_01C51355.A5597B60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

merci j'avais pas vu la valeur de mon handle !!
ça marche maintenant au niveau de la compilation mais la résolution ne change pas comme voulu...bouh.....
"Pascal B." Bonjour Frank,

Controle la déclaration des arguments de la fonction et la définition des Type
Je ne pense pas que INTEGER soit approprié (en 32Bits.)
Remplace le par LONG

Cordialement

Pascal B.

"Franck" Hello tout le monde, voici un nouveau p'tit problème sous vb6.....

J'essaie de forcer le format de ma webcam en utilisant sendmessage....

Voici ce que j'ai fait


Declare Function SendMessageAsBitMap Lib "user32" Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByRef lParam As BITMAPINFO) As Integer

Public Const WM_CAP_SET_VIDEOFORMAT As Long = &H42D

Public Type BITMAPINFOHEADER
biSize As Integer
biWidth As Integer
biHeight As Integer
biPlanes As Long
biBitCount As Long
biCompression As Integer
biSizeImage As Integer
biXPelsPerMeter As Integer
biYPelsPerMeter As Integer
biClrUsed As Integer
biClrImportant As Integer
End Type



Public Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors() As Integer
End Type


sub test ()
Dim bmp As BITMAPINFO

With bmp.bmiHeader
.biSize = Len(bmp.bmiHeader)
.biWidth = 320
.biHeight = 240
.biPlanes = 1
.biBitCount = 24
End With

Retour = SendMessageAsBitMap(hWnd, WM_CAP_SET_VIDEOFORMAT, Len(bmp), bmp)

ça plante ici en me disant que j'ai un dépassement de capacité.....alors je dois être un peu miro mais je vois pas ou ???? HELP

end sub






------=_NextPart_000_0008_01C51355.A5597B60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff style="COLOR: #000000; FONT-FAMILY: ">
<BLOCKQUOTE idb147e6>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>merci j'avais pas vu la valeur de mon handle
!!</FONT></DIV>
<DIV>ça marche maintenant au niveau de la compilation mais la résolution ne
change pas comme voulu...bouh.....</DIV></FONT></DIV>
<BLOCKQUOTE dir=ltr
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV>"Pascal B." &lt;<A
href="mailto:"> om</A>&gt;
a écrit dans le message news: <A
href="mailto:"> 2msftngp13.phx.gbl <DIV><FONT face=Arial size=2>Bonjour Frank,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Controle la déclaration des arguments de la
fonction et la définition des Type</FONT></DIV>
<DIV><FONT face=Arial size=2>Je ne pense pas que INTEGER soit approprié (en
32Bits.)</FONT></DIV>
<DIV><FONT face=Arial size=2>Remplace le par LONG</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Cordialement</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV>"Franck" &lt;<A
href="mailto:"> om</A>&gt;
wrote in message <A
href="news:">news:uDdIEGrEFHA.3512 @TK2MSFTNGP10.phx.gbl id=HbSession SessionId="3639130721"></LABEL>
<DIV><FONT face=Arial size=2>Hello tout le monde, voici un nouveau p'tit
problème sous vb6.....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>J'essaie de forcer le format de ma webcam en
utilisant&nbsp;sendmessage....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Voici ce que j'ai fait&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Declare Function SendMessageAsBitMap Lib
"user32" Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As
Integer, ByVal wParam As Integer, ByRef lParam As BITMAPINFO) As
Integer</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Const WM_CAP_SET_VIDEOFORMAT As Long =
&amp;H42D</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Type
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSize As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biWidth As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biHeight As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biPlanes As
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biBitCount As
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biCompression As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSizeImage As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biXPelsPerMeter As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biYPelsPerMeter As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biClrUsed As
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biClrImportant As
Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Public Type
BITMAPINFO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmiHeader As
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmiColors()
As Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>sub test ()</FONT></DIV>
<DIV><FONT face=Arial size=2>Dim bmp As BITMAPINFO</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp; With
bmp.bmiHeader<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biSize =
Len(bmp.bmiHeader)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biWidth =
320<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biHeight =
240<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biPlanes =
1 With</FONT></DIV>
<DIV><BR><FONT color=#800000 face=Arial size=2>Retour =
SendMessageAsBitMap(hWnd, WM_CAP_SET_VIDEOFORMAT, Len(bmp),
bmp)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#800000 face=Arial size=2>ça plante ici en me disant que
j'ai un dépassement de capacité.....alors je dois être un peu miro mais je
vois pas ou ???? HELP</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>end sub</FONT></DIV>
<DIV>&nbsp;</DIV>
<P></P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<P></P></BODY></HTML>

------=_NextPart_000_0008_01C51355.A5597B60--
Poster une réponse
Anonyme