Sign in to follow this  
Followers 0
lilx

code build problems.

3 posts in this topic

Hello,

I am trying to make a program that makes pictures with your webcam wel i found in the example forum, a great example and it works. Now I am tryin something new to and thats the gdiplus function for a way much finer look of your program.. now the problem is. I did had thos two functions working together earlier. But then I changed my design and started over. now I did encounter a problem where I dont know what I am doing wrong or how to fix it.

Well this a short version of the script..

#include <GDIPlus.au3>
#include <GUIConstants.au3>
#include <GuiComboBox.au3>
#include <File.au3>
#include <Array.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <ButtonConstants.au3>
#include <Webcam.au3>
Global Const $AC_SRC_ALPHA = 1
Opt("MustDeclareVars", 0)
_WebcamInit()
$snapfile = @ScriptDir & "\scrshot.bmp"

; Load PNG file as GDI bitmap
_GDIPlus_Startup()
$pngSrc = @ScriptDir & "\123qw.png"
$hImage = _GDIPlus_ImageLoadFromFile($pngSrc)
$width = _GDIPlus_ImageGetWidth($hImage)
$height = _GDIPlus_ImageGetHeight($hImage)

;Gui
$Main = GUICreate("PowerHouse Picture Program", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
SetBitmap($Main, $hImage, 0)

$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 8, "int", 89, "int", 320, "int", 240, "hwnd", $Main, "int", 1)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0)
DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0)

GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
WinSetOnTop($Main, "", 1)
;fade in png background
For $i = 0 To 255 Step 10
    SetBitmap($Main, $hImage, $i)
Next

GUISetState(@SW_SHOW)

Now the problem is when I run the script, it works perfectly but, I doesnt show my webcam window..

and when i change this, It show my webcam window but now I dun have my gdiplus background

$Main = GUICreate("PowerHouse Picture Program", $width, $height, -1, -1, $WS_POPUP)

default is

$Main = GUICreate("PowerHouse Picture Program", $width, $height, -1, -1, $WS_POPUP, $WS_EX_LAYERED)

So can somebody look at this code and help me with it please because I cant find the problem.

thx in advance, i hope it did make it as clear as possible with my english :)

Share this post


Link to post
Share on other sites



So can somebody look at this code and help me with it please because I cant find the problem.

thx in advance, i hope it did make it as clear as possible with my english :)

Someone else might know but I would need to see something that I could run and which demonstrated the problem. What does SetBitmap do for example? Can you supply a sample bitmap to use and the 123qw.pn file?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

ok well did zip my whole project to a zip and uploaded it, hope you can identify the problem now

edit, i did found the probleem just needed a child gui..

Webcam.zip

Edited by lilx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0