{"id":332,"date":"2010-08-31T20:20:51","date_gmt":"2010-09-01T01:20:51","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=332"},"modified":"2021-03-09T08:15:10","modified_gmt":"2021-03-09T13:15:10","slug":"powerbuilder-capture-images-from-webcam","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-capture-images-from-webcam\/","title":{"rendered":"PowerBuilder &#8211; Capture Images from Webcam"},"content":{"rendered":"<p>Here&#8217;s some code to capture an image from a webcam in Powerbuilder using EZTWAIN.  It worked fine on my Vista Home Premium laptop.  I came across it earlier in 2010 but the blog page seems to be gone now.  If you know the author, let me know so I can give credit.<\/p>\n<p>The file and excellent information can be found at <a href=\"http:\/\/www.dosadi.com\/eztwain1.htm\">www.dosadi.com\/eztwain1.htm<\/a><\/p>\n<p>The readme mentions putting the eztw32.dll file in the application folder rather than system32 which I think is a good idea.  You don&#8217;t have to register the dll.<\/p>\n<pre name=\"code\" class=\"VB\">Global Variables\nlong mCapHwnd\nConstant LONG WM_CAP_DRIVER_CONNECT = 1034\nConstant Long WM_CAP_DRIVER_DISCONNECT = 1035\nConstant Long WM_CAP_GRAB_FRAME = 1084\nConstant Long WM_CAP_EDIT_COPY = 1054\nConstant Long WM_CAP_DLG_VIDEOFORMAT = 1065\nConstant Long WM_CAP_DLG_VIDEOSOURCE = 1066\nConstant String WM_CLOSE = &#039;H10&#039;\n\nGlobal External Functions\nFUNCTION long DIB_WriteToBmp(long hdib, string pz) LIBRARY &#039;EZTW32.DLL&#039; alias for &#039;DIB_WriteToBmp;Ansi&#039;\nFUNCTION long TWAIN_AcquireNative(long hwndApp, uint wPixTypes) LIBRARY &#039;EZTW32.DLL&#039;\nFUNCTION long TWAIN_AcquireToClipboard (long hwndApp, uint wPixTypes)  LIBRARY &#039;EZTW32.DLL&#039;\nFUNCTION long TWAIN_AcquireToFilename (long hwndApp, string pz)  LIBRARY &#039;EZTW32.DLL&#039; alias for &#039;TWAIN_AcquireToFilename;Ansi&#039;\nFUNCTION long TWAIN_FreeNative(long hdib)  LIBRARY &#039;EZTW32.DLL&#039;\nFUNCTION long TWAIN_SelectImageSource (long hwnd) LIBRARY &#039;EZTW32.DLL&#039;\nFUNCTION long TWAIN_SetSaveFormat(int nFF) LIBRARY &#039;EZTW32.DLL&#039;\n\nPut a Picture button control (pb_1) and a Command button (cb_1) to capture the image.\n\nIn the Clicked event of cb_1 :\n\nlong ll_ret\nll_ret = TWAIN_AcquireToFilename(0, &quot;c:\\temp\\result.bmp&quot;)\npb_1.picturename=&#039;c:\\temp\\result.bmp&#039;<\/pre>\n<p>This is the extent of my use of this.  I&#8217;m sure much more can be achieved given enough time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s some code to capture an image from a webcam in Powerbuilder using EZTWAIN. It worked fine on my Vista Home Premium laptop. I came across it earlier in 2010 but the blog page seems to be gone now. If you know the author, let me know so I can give credit. The file and&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,16,31],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/332"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=332"}],"version-history":[{"count":8,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/332\/revisions"}],"predecessor-version":[{"id":1810,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/332\/revisions\/1810"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=332"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=332"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=332"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}