JMF - Vista
Posted by Peter Stierlen on Oct 02, 2007; 12:53am
URL: http://imagej.273.s1.nabble.com/JMF-Vista-tp3698295.html
Dear ImageJ friends,
last week I bought a new Vista-PC. So I am also affected now by this
Vista-JMF problems as many others too. Attached you can find a short
excerpt from my 3d-scanning tool which worked fine on XP but not on this
new VISTA Teletubby-System.
But I found that the JMStudio works well. But looking at the JMStudio
source code I had no idea up to now what to change on my program. So I
hope that someone out there can give me a solution for this problem.
Thanks in advance
Peter Stierlen
else if (source == preView)
{
n=0;
if (preView.isSelected())
{
IJ.write("Preview on");
JWindow jf=new JWindow();
JWindow mask=new JWindow();
VideoFormat format = new VideoFormat(VideoFormat.MJPG,new
Dimension(640,480), Format.NOT_SPECIFIED,null,15);
Vector deviceList = CaptureDeviceManager.getDeviceList(format);
CaptureDeviceInfo device = (CaptureDeviceInfo)
deviceList.firstElement();
Format[] formats = device.getFormats();
IJ.write("Aktuelle Capture Device: "+ device.getName());
for (int i = 0; i < deviceList.size(); i++){
IJ.write("\t" + (CaptureDeviceInfo)
deviceList.elementAt(i));
}
try {
p = Manager.createRealizedPlayer(device.getLocator());
formatControl = (FormatControl)p.getControl (
"javax.media.control.FormatControl" );
formatControl.setFormat ( formats[0] );
} catch (Exception e) {
IJ.write("Failed to create a player from the given
DataSource:\n \n" + e.getMessage());
return;
}
IJ.wait(1500);
Container contentPane = jf.getContentPane();
Container contentPaneMask = mask.getContentPane();
contentPaneMask.setBackground (Color.green);
jf.setBackground (Color.gray);
setLayout(new BorderLayout());
p.start();
Component comp = p.getVisualComponent();
if ((comp = p.getVisualComponent()) != null){
comp.setBounds(5,5,640, 480);
contentPane.add(comp);
}
repaint();
jf.setSize(650,490);
jf.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width-650-10),10);
jf.setVisible(true);
mask.setSize(1,490);
mask.setVisible(true);
mask.setLocation((Toolkit.getDefaultToolkit().getScreenSize().width-(650/2)-10),10);
IJ.write(""+jf.getLocation());
n=0;
}