best bet for using a .NET dll

W

Warren Jackson

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.
 
V

Virgil Dupras

Warren said:
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.
 
F

Fuzzyman

Warren said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top