Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Forcer le format d'une webcam !

1 réponse
Avatar
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 probl=E8me sous vb6.....

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

Voici ce que j'ai fait =20


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 =3D &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 =3D Len(bmp.bmiHeader)
.biWidth =3D 320
.biHeight =3D 240
.biPlanes =3D 1
.biBitCount =3D 24
End With

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

=E7a plante ici en me disant que j'ai un d=E9passement de =
capacit=E9.....alors je dois =EAtre 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=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3819.300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"COLOR: #000000; FONT-FAMILY: "><LABEL id=3DHbSession=20
SessionId=3D"3065071590"></LABEL>
<DIV><FONT face=3DArial size=3D2>Hello tout le monde, voici un nouveau =
p'tit=20
probl=E8me sous vb6.....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>J'essaie de forcer le format de ma =
webcam en=20
utilisant&nbsp;sendmessage....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Voici ce que j'ai fait&nbsp; =
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Declare Function SendMessageAsBitMap =
Lib "user32"=20
Alias "SendMessageA" (ByVal hWnd As Integer, ByVal wMsg As Integer, =
ByVal wParam=20
As Integer, ByRef lParam As BITMAPINFO) As Integer</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Public Const WM_CAP_SET_VIDEOFORMAT As =
Long =3D=20
&amp;H42D</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Public Type=20
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSize As =

Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biWidth As=20
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biHeight As=20
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biPlanes As=20
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biBitCount As=20
Long<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biCompression As=20
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biSizeImage As=20
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=20
Integer<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; biClrImportant As=20
Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Public Type=20
BITMAPINFO<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmiHeader As=20
BITMAPINFOHEADER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
bmiColors() As=20
Integer<BR>End Type</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>sub test ()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Dim bmp As BITMAPINFO</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; With=20
bmp.bmiHeader<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biSize =3D=20
Len(bmp.bmiHeader)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biWidth =3D=20
320<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biHeight =3D=20
240<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biPlanes =3D=20
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .biBitCount =3D 24<BR>&nbsp;&nbsp; =
End=20
With</FONT></DIV>
<DIV><BR><FONT color=3D#800000 face=3DArial size=3D2>Retour =3D=20
SendMessageAsBitMap(hWnd, WM_CAP_SET_VIDEOFORMAT, Len(bmp), =
bmp)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#800000 face=3DArial size=3D2>=E7a plante ici en me =
disant que j'ai=20
un d=E9passement de capacit=E9.....alors je dois =EAtre un peu miro mais =
je vois pas=20
ou ???? HELP</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>end sub</FONT></DIV>
<DIV>&nbsp;</DIV>
<P></P></BODY></HTML>

------=_NextPart_000_000C_01C512B9.E4949680--

1 réponse

Avatar
Franck
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." a écrit dans le message news:
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" wrote in message news:
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

<!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 bgColor=#ffffff style="COLOR: #000000; FONT-FAMILY: ">
<BLOCKQUOTE id¶b147e6>
<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</A>...</DIV>
<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>Pascal B.</FONT></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</A>...</DIV><LABEL
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<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 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--