By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,403 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,403 IT Pros & Developers. It's quick & easy.

best bet for using a .NET dll

P: n/a
I'd like to make a simple program that uses the Canon digital camera
SDK (EDSDK 1.3). Basically I need to take pictures and download them
to my computer. They have a fair amount of example code for the .NET
languages, and don't officially support anything else.

The API uses more than the basic c types (references, etc.) that I'm
not totally familiar with yet. Included at the bottom is an example
of one of the functions.

What is my best bet for writing this in Python? cTypes, IronPython,
something else? I haven't worked with either before but am currently
reading up. It seams cTypes has a difficult time dealing with
anything but the 'normal' c types, is this correct?

Would it be easier to just write a program in C# to handle all of the
fancy types? (ie. make a function that opens and closes session, finds
camera, takes picture, downloads picture, saves picture - that can
then be read in python) ? This isn't a very attractive option to me.

Thanks in advance for any insight.


3.1.24 EdsDownload

Description:
Downloads a file on a remote camera (in the camera memory or on a
memory card) to the host computer. The downloaded file is sent
directly to a file stream created in advance.
When dividing the file being retrieved, call this API repeatedly. Also
in this case, make the data block size a multiple of 512 (bytes),
excluding the final block.

Syntax
EdsError EDSAPI EdsDownload( EdsDirectoryItemRef inDirItemRef,
EdsUInt32 inReadSize,
EdsStreamRef outStreamRef )

Parameters
inDirItemRef
Designate the file object in the camera to download.
inReadSize
Designate the size in bytes to download.
outStreamRef
Specifies the destination stream. The stream for downloading is
created by means of EdsCreateFileStream, EdsCreateMemoryStream, or the
like.

Return Values
Returns EDS_ERR_OK if successful. In other cases, see the EDS Error Lists.
Nov 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

Warren Jackson wrote:
I'd like to make a simple program that uses the Canon digital camera
SDK (EDSDK 1.3). Basically I need to take pictures and download them
to my computer. They have a fair amount of example code for the .NET
languages, and don't officially support anything else.

The API uses more than the basic c types (references, etc.) that I'm
not totally familiar with yet. Included at the bottom is an example
of one of the functions.

What is my best bet for writing this in Python? cTypes, IronPython,
something else? I haven't worked with either before but am currently
reading up. It seams cTypes has a difficult time dealing with
anything but the 'normal' c types, is this correct?

Would it be easier to just write a program in C# to handle all of the
fancy types? (ie. make a function that opens and closes session, finds
camera, takes picture, downloads picture, saves picture - that can
then be read in python) ? This isn't a very attractive option to me.

Thanks in advance for any insight.


3.1.24 EdsDownload

Description:
Downloads a file on a remote camera (in the camera memory or on a
memory card) to the host computer. The downloaded file is sent
directly to a file stream created in advance.
When dividing the file being retrieved, call this API repeatedly. Also
in this case, make the data block size a multiple of 512 (bytes),
excluding the final block.

Syntax
EdsError EDSAPI EdsDownload( EdsDirectoryItemRef inDirItemRef,
EdsUInt32 inReadSize,
EdsStreamRef outStreamRef )

Parameters
inDirItemRef
Designate the file object in the camera to download.
inReadSize
Designate the size in bytes to download.
outStreamRef
Specifies the destination stream. The stream for downloading is
created by means of EdsCreateFileStream, EdsCreateMemoryStream, or the
like.

Return Values
Returns EDS_ERR_OK if successful. In other cases, see the EDS Error Lists.
There is also "Python for .Net", which is simply a bridge (as opposed
to IronPython, which is a complete python implementation). It works
pretty well.

Nov 21 '06 #2

P: n/a

Warren Jackson wrote:
I'd like to make a simple program that uses the Canon digital camera
SDK (EDSDK 1.3). Basically I need to take pictures and download them
to my computer. They have a fair amount of example code for the .NET
languages, and don't officially support anything else.

The API uses more than the basic c types (references, etc.) that I'm
not totally familiar with yet. Included at the bottom is an example
of one of the functions.

What is my best bet for writing this in Python? cTypes, IronPython,
something else? I haven't worked with either before but am currently
reading up. It seams cTypes has a difficult time dealing with
anything but the 'normal' c types, is this correct?

Would it be easier to just write a program in C# to handle all of the
fancy types? (ie. make a function that opens and closes session, finds
camera, takes picture, downloads picture, saves picture - that can
then be read in python) ? This isn't a very attractive option to me.

Thanks in advance for any insight.
This sounds like the sort of thing for which IronPython is ideal. It
should eliminate the need for C# unless you have to mark classes with
attributes (In which case you should be able to get away with a stub
class.)

Fuzzyman
http://www.voidspace.org.uk/index2.shtml

Nov 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.