Note that there are some explanatory texts on larger screens.

plurals
  1. PORetrieving pictures from Canon camera using EDSDK 2.9
    primarykey
    data
    text
    <p>I been trying to retrieve images taken on the camera for a very long time now. I am able to take pictures with the SDK using:</p> <p>err = EDSDK.EdsSendCommand(cameraDev, EDSDK.CameraCommand_TakePicture, 0);</p> <p>I do this after opening a valid camera session. I have also added a </p> <p>objectEventHandler and a stateEventHandler for the events that look like:</p> <pre><code> public static uint stateEventHandler(uint inEvent, uint inParameter, IntPtr inContext) { switch (inEvent) { case EDSDK.StateEvent_JobStatusChanged: Debug.WriteLine(String.Format("There are objects waiting to be transferred. Job status {0}", inParameter)); break; case EDSDK.StateEvent_ShutDownTimerUpdate: if (inParameter != 0) Debug.WriteLine(String.Format("shutdown timer update: {0}", inParameter)); break; default: Debug.WriteLine(String.Format("StateEventHandler: event {0}, parameter {1}", inEvent, inParameter)); break; } return 0; } </code></pre> <hr> <pre><code> public static uint objectEventHandler(uint inEvent, IntPtr inRef, IntPtr inContext) { switch (inEvent) { case EDSDK.ObjectEvent_VolumeInfoChanged: Debug.WriteLine("volume info changed"); #region retrieve volume info EDSDK.EdsVolumeInfo volumeInfo; err = EDSDK.EdsGetVolumeInfo(inRef, out volumeInfo); if (err == EDSDK.EDS_ERR_OK) { switch (volumeInfo.StorageType) { case (uint)EDSDK.EdsStorageType.Non: Debug.WriteLine("No card inserted"); break; default: case (uint)EDSDK.EdsStorageType.CF: case (uint)EDSDK.EdsStorageType.SD: if (volumeInfo.Access == (uint)EDSDK.EdsAccess.ReadWrite) { Debug.WriteLine(String.Format("Label: {0}, Max Capacity: {1}, Free Space: {2}", volumeInfo.szVolumeLabel, volumeInfo.MaxCapacity, volumeInfo.FreeSpaceInBytes)); /* err = EDSDK.EdsGetChildAtIndex(volumeInfo, 0, directoryList); if (err != EDSDK.EDS_ERR_OK) throw new Exception(String.Format("EdsGetChildAtIndex: " + err.ToString())); */ } else Debug.WriteLine(String.Format("Volume access rights: {0}", volumeInfo.Access)); break; } } #endregion retrieve volume info break; case EDSDK.ObjectEvent_DirItemCreated: downloadImage(inContext); Debug.WriteLine("dir item created"); break; default: Debug.WriteLine(String.Format("ObjectEventHandler: event {0}", inEvent)); break; } return 0; } </code></pre> <p>I have tried multiple approaches (to retrieve this image) none of them seem to work. Some of the approaches are:</p> <p><a href="http://tech.groups.yahoo.com/group/CanonSDK/message/1575" rel="nofollow">http://tech.groups.yahoo.com/group/CanonSDK/message/1575</a></p> <p>[http://stackoverflow.com/questions/3762530/take-picture-and-directly-save-image-to-pc-using-edsdk-2-8]</p> <p>[http://canonsdk.com/phpBB3/viewtopic.php?f=7&amp;t=94&amp;sid=7fcbe7ad6eadb399dbcb4b61a7333112]</p> <p>The thing is all of them are just part of the code, when I try to put it in mine, it never works properly.Probably because I am no expert on memoryStreams, pointers an so. Most of the errors I get are when reading the streams and copying them to a local buffer, it says the stream is empty. </p> <p>Does anybody have full sample code for taking a picture and downloading it to disk (or to memory), or the rigth approach that I need in order to complete this?</p> <p>Thanks Fernando</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload