_ScreenCapture_Capture() fails, presumably due to missing GDI+ encoders - screenshot

I would like to do a screen capture using AutoIt. My code:
#include <ScreenCapture.au3>
_ScreenCapture_Capture(#ScriptDir & "/test.jpg")
This doesn't work. And I know why. I tested what encoders I have:
#include <GDIPlus.au3>
$Encoders = _GDIPlus_Encoders()
MsgBox(0, "", UBound($Encoders))
The result is: 0. So why don't I have any encoders? And how can I get any?

This doesn't work. And I know why.
AutoIt v3.3.14.3 has a bug. Install latest version and it should work. Related.

Related

Lua, Altered Program Flow When Rquired File isn't there

I want to test to see if a require'd file is there or not.
At the present, when I execute this command in Lua:
require "File_That_May_or_May_Not_Be_There.inc"
All is well if he's there. If not, my script is dead on the spot.
Is there a way for me to recover from this ?
I looked HERE on the Lua.Org site and HERE on StackOverflow and haven't seen this answered.
Is there a way to do something like this ?...
if (this_exists("That_File")) then
require "That_File"
else
print "Your file does not exist"
end
I'm trying to let the user have a little better idea of what went wrong, and why.
Use pcall.
local ok, mod = pcall(require, "That_File")
If you don't need to use require, which looks for modules in several locations, you can use
local f,e=loadfile(filename)
if f==nil then
print(e)
else
f()
end

enableGesture(); error on Kinect SimpleOpenNI

everyone. I'm have a problem and i don't no how to solve it. I try to make some tutorials with Hand click on Processing, and always happened the same error, the function enableGesture(); does not exist. What I can do? Can someone Help me?
Thank You
whether it's
kinect.enableGesture();
or
context.enableGesture();
it doesn't matter it just depends on the variable your code chose in this line
SimpleOpenNI 'variable name here' = new SimpleOpenNI(this);
The function enableGesture(); is out of date
All you have to do is change enableGesture(); to startGesture(SimpleOpenNI."gesture");
Where "gesture" can be either
GESTURE_CLICK, GESTURE_HAND_RAISE or GESTURE_WAVE
And it is most likely that you will encounter other out of date functions such as:
enableHands(); which is now enableHand();
addGesture(String); which is now startGesture(SimpleOpenNI."gesture");
removeGesture(String); which is now endGesture(SimpleOpenNI."gesture");
startTrackingHands(PVector); which is now startTrackingHand(PVector);
Hope this Helps
- E.B.
i think this is because of the simpleopenni version you are using. try using
SimpleOpenNI context = new SimpleOpenNI(this);
context.startGesture(SimpleOpenNI.GESTURE_CLICK);
//change constant for other gestures

autoconf: how to check for presence of #define

I am writing a program that uses boost::asio to access serial ports. According to the documentation, serial port support is available when the BOOST_ASIO_HAS_SERIAL_PORT macro is defined. Since this is a requirement, I want my configure script to abort if the macro has not been defined.
I thought I could achieve this with something like the following:
AC_MSG_CHECKING([for serial port support in boost::asio])
AC_EGREP_CPP(yes_have_boost_asio_serial, [
#include <boost/asio.hpp>
#ifdef BOOST_ASIO_HAS_SERIAL_PORT
yes_have_boost_asio_serial
#endif
], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
AC_ERROR([boost::asio must be compiled with serial port support enabled])
])
Unfortunately when I put this in, I get a weird error when generating the configure script:
configure.ac:23: error: possibly undefined macro: BOOST_ASIO_HAS_SERIAL_PORT
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Why is autoconf seeing macros inside my code? The documentation on m4_pattern_allow more or less says if you have to use it something has gone wrong, so what have I done wrong?
I ended up just using m4_pattern_allow, I guess it has something to do with an all-uppercase symbol looking like something autoconf should deal with?
m4_pattern_allow([BOOST_ASIO_HAS_SERIAL_PORT])
AC_MSG_CHECKING([for serial port support in boost::asio])
...

LinkedInApi class with scope

I am trying out LinkedInExampleWithScopes.java example from scribe-java.
However, it errors out on .provider(LinkedInApi.withScopes("foo", "bar", "baz")).
withScopes() is not recognized as part of scribe-1.3.3.jar.
Please advise which scribe-java version is the withScopes() included in.
I had the same problem but 'scibe-1.3.5.jar' works well. Try it.
Download link: http://mvnrepository.com/artifact/org.scribe/scribe/1.3.5

FileUploadDialogHandler()

I am trying to automate a web app which involves selecting an existing file using a fileuploaddialoghandler() method and entering the full path in the file name dropdown then Open click.
However, when I attempt this using this code
FileUploadDialogHandler fileupload = new FileUploadDialogHandler(#"C:\TIFFiles\Testtif.TIF");
//browser.WaitForComplete();
using (new UseDialogOnce(browser.DialogWatcher, fileupload))
{
newIee.Button(Find.ById("ctl00_WebPartManager1_FileUpload_FileBrowse")).ClickNoWait();
browser.AddDialogHandler(fileupload);
browser.WaitForComplete();
browser.RemoveDialogHandler(fileupload);
}
It does not work.
What else should I be doing?
Thanks much!
W
I just have one question about your code... What is newIee? I can't tell by looking at the code if newIee is attached to browser. Other than that, your FileUpdateDialogHandler should be fine.
If you can provide the code where you declare newIee, it might add me in determining if it's a factor causing your code not to work properly.