Just starting out? Need help? Post your questions and find answers here.
Sparkie
PureBatMan Forever
Posts: 2307 Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA
Post
by Sparkie » Wed Jul 28, 2004 12:09 am
@Wolf - You're missing the SetWindowCallback. Add it just before you take the Snapshot()
Code: Select all
SetWindowCallback(@myWindowCallback())
snapshot()
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
Wolf
Enthusiast
Posts: 232 Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T
Post
by Wolf » Wed Jul 28, 2004 12:29 am
Oh yes
I now add it and work perfect.
Sparkie i always thank you for your nice helps
Best regards.
Sparkie
PureBatMan Forever
Posts: 2307 Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA
Post
by Sparkie » Wed Jul 28, 2004 12:34 am
Always glad to help Wolf
I'll let you know if and when I find a better method of handling the Video Source window.
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
real
User
Posts: 49 Joined: Fri Oct 08, 2004 5:17 am
Post
by real » Tue Oct 20, 2009 11:47 pm
Sorry for re-opening this topic...
Could anybody give me an example, how to change the resolution to 640 x 480 pixels without any dialogs... please? I'd like to make a snapshot in 640 x 480 and this is supported by the webcam, but standard webcam is a resolution of 352 x 288 pixels.
Thanks,
René
Windows 7 x64, PureBasic 4.31 & 4.40b4 x86
Sparkie
PureBatMan Forever
Posts: 2307 Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA
Post
by Sparkie » Wed Oct 21, 2009 2:52 am
I believe WM_CAP_SET_VIDEOFORMAT will do what you want. I won't have time to try it out until this weekend.
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
real
User
Posts: 49 Joined: Fri Oct 08, 2004 5:17 am
Post
by real » Wed Oct 21, 2009 10:36 am
Okay, I know that i have to pass it via SendMessage_() to the capture window, but I'm note sure about the parameters to use.
Windows 7 x64, PureBasic 4.31 & 4.40b4 x86
Sparkie
PureBatMan Forever
Posts: 2307 Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA
Post
by Sparkie » Thu Oct 22, 2009 12:38 am
See if this helps you until I have time to finish the code.
Code: Select all
bmi.BITMAPINFO
bmi\bmiHeader\biSize = SizeOf(BITMAPINFOHEADER)
;Use zero parameters to get current struct size
structSize = SendMessage_(hWndC, #WM_CAP_GET_VIDEOFORMAT, 0, 0)
;Now use corrected parameters to get info
SendMessage_(hWndC, #WM_CAP_GET_VIDEOFORMAT, structSize, @bmi)
;Change to a valid size only or crash will occur
bmi\bmiHeader\biWidth = 640
bmi\bmiHeader\biHeight = 480
bmi\bmiHeader\biSizeImage = bmi\bmiHeader\biHeight * bmi\bmiHeader\biWidth * 3
bmi\bmiHeader\biBitCount = 24
;Set new size
SendMessage_(hWndC, #WM_CAP_SET_VIDEOFORMAT, structSize, bmi)
capW = bmi\bmiHeader\biWidth
capH = bmi\bmiHeader\biHeight
SetWindowPos_(hWndC, 0, 0, 0, capW, capH, #SWP_NOMOVE | #SWP_NOZORDER | #SWP_FRAMECHANGED)
UpdateWindow_(hWndC)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1