kritzikratzi / edsdk4j

Canon SDK for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

E04_LiveView as JApplet

Chaithanya-Bangaru opened this issue · comments

Hi, The file E04_LiveView.java has a main method,
I removed it and added Applet's init method by extending to JApplet like below, It is giving
public class E04_LiveView extends JApplet{
// public static void main( final String[] args ) throws InterruptedException {
//public void init() {
....
Getting below error, but its fine when I use the main method, What might be the issue Hans ?
Java Architecture: x86 - Using EDSDK DLL: EDSDK/Dll/EDSDK.dll
java.lang.UnsatisfiedLinkError: Unable to load library 'EDSDK/Dll/EDSDK.dll': The specified module could not be found.

it means exactly this: Unable to load library 'EDSDK/Dll/EDSDK.dll': The specified module could not be found.

i would add the following line:
System.out.println( new File( "./" ).getAbsolutePath() );

this should print the current working directory. open that directory, if it doesn't contain the EDSDK folder from canon then you know what the problem is :)

best, h

Thanks, I its a class path issue, where canon sdk is not available
One favor I need hans or ananta, where I'm stuck,
I think it would be 10 min for you to launch live view from web page,I want to embed this live view in html please help..i need to wrap up this task before this week...Thanks in advance!

Hello Hans, I solved the web page access issue too,really pain to sign jars to show in applet, Man, I am trying to integrate E04_Liveview.java and SinglePhoto.java so that before clicking on take photo button user can have a live view can you guess what is wrong with the below code ?
In live view I added new button and its listener in separate class
button.addActionListener( new ButtonListener(camera, frame, label) );

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

import javax.swing.AbstractButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingWorker;

import edsdk.api.CanonCamera;

public final class ButtonListener implements ActionListener {

protected CanonCamera camera;
protected JFrame frame;
protected JLabel label;
ButtonListener(CanonCamera camera,JFrame frame , JLabel label ){
    this.camera = camera;
    this.frame = frame;
    this.label = label;
}
@Override
public void actionPerformed( final ActionEvent e ) {
    final AbstractButton button = (AbstractButton) e.getSource();
    final String oldText = button.getText();
    button.setText( "Please wait, Rendering..." );
    button.setEnabled( false );
    new SwingWorker<File[], Object>() {

        @Override
        protected File[] doInBackground() throws Exception {
            return SinglePhoto.takePhoto( camera );
        }

        @Override
        protected void done() {
            try {
                SinglePhoto.updateImage( frame, label, get() );
                button.setText( oldText );
                button.setEnabled( true );
            }
            catch ( final Exception e ) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }.execute();
}

}

I heard swing is thread un safe, any idea Mr Hans Raber to integrate SingleShoot and Live view samples together ??

this is becoming more of a support request than a bug report.
closing, i don't see a problem related to this library here.

please use stackoverflow, irc, or one of the many programming resources available online.

Ok, np, I will check resources online,But I cant ask some one else to know the issue in integrating those two files..it would be better if you'd have given an example,no one shoots from the camera without a live view.anyway ty for this library.