[問題] 有關JMF截圖問題
這是片段的程式碼
private class ButtonHandler implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
// Grab a frame
// Convert it to an image
FrameGrabbingControl fgc =
(FrameGrabbingControl)playerL.getControl("javax.media.control.FrameGrabbingControl");
buf = fgc.grabFrame();
btoi = new BufferToImage((VideoFormat)buf.getFormat());
img = btoi.createImage(buf);
// show the image
imgpanelLeft.setImage(img);
imgpanelLeft.repaint();
savePNG(img,"test");
}
}
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at SwingCapture$ButtonHandler.actionPerformed(SwingCapture.java:120)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
錯誤訊息是指向FrameGrabbingControl
其中還有很多函式的匯入都是顯示(Unknow Sorce)
想請問大家這個FrameGrabbingControl到底是什麼出現問題??
可以麻煩各位神手為我解惑嗎...
這個問題我想一兩個禮拜了...
麻煩大家了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.122.146.55
推
10/27 13:40, , 1F
10/27 13:40, 1F
※ 編輯: needFresh 來自: 122.122.146.55 (10/27 13:59)
→
10/27 13:59, , 2F
10/27 13:59, 2F
推
10/27 14:24, , 3F
10/27 14:24, 3F
→
10/27 14:38, , 4F
10/27 14:38, 4F
→
10/27 16:41, , 5F
10/27 16:41, 5F
→
10/27 19:14, , 6F
10/27 19:14, 6F
→
10/27 19:58, , 7F
10/27 19:58, 7F
→
10/27 21:01, , 8F
10/27 21:01, 8F
→
10/28 14:58, , 9F
10/28 14:58, 9F