Swing/AnimatedGif のバックアップの現在との差分(No.3)
- バックアップ一覧
- 差分 を表示
- 現在との差分 - Visual を表示
- ソース を表示
- バックアップ を表示
- Swing/AnimatedGif へ行く。
- 1 (2007-05-14 (月) 19:32:29)
- 2 (2009-05-14 (木) 19:32:37)
- 3 (2009-05-14 (木) 21:14:04)
- 4 (2010-12-12 (日) 23:18:31)
- 5 (2013-02-06 (水) 02:12:30)
- 6 (2013-08-17 (土) 01:08:37)
- 7 (2014-12-02 (火) 15:57:05)
- 8 (2015-06-22 (月) 17:59:29)
- 9 (2016-05-26 (木) 14:23:51)
- 10 (2017-09-01 (金) 17:39:02)
- 11 (2018-09-04 (火) 15:03:29)
- 12 (2018-10-15 (月) 13:18:28)
- 13 (2020-10-13 (火) 18:26:58)
- 14 (2022-07-29 (金) 11:29:47)
- 15 (2022-11-07 (月) 17:56:02)
- 追加された行はこの色です。
- 削除された行はこの色です。
TITLE:Animated GIFでのコマ描画時処理 #navi(../) RIGHT:Posted by [[terai]] at 2007-05-14 *Animated GIFでのコマ描画時処理 [#c03dda88] JLabelなどで使用できるAnimated GIFファイルをテストします。 --- category: swing folder: AnimatedGif title: Animated GIFでのコマ描画時処理 tags: [JLabel, Animation, AnimatedGif] author: aterai pubdate: 2007-05-14T19:32:29+09:00 description: JLabelなどで使用できるAnimated GIFファイルをテストします。 image: https://lh3.googleusercontent.com/_9Z4BYR88imo/TQTHnR-lE1I/AAAAAAAAARc/gDDOKXhD7hQ/s800/AnimatedGif.png --- * 概要 [#summary] `JLabel`などで使用できる`Animated GIF`ファイルをテストします。 -&jnlp; -&jar; -&zip; #download(https://lh3.googleusercontent.com/_9Z4BYR88imo/TQTHnR-lE1I/AAAAAAAAARc/gDDOKXhD7hQ/s800/AnimatedGif.png) #screenshot * サンプルコード [#sourcecode] #code(link){{ JLabel label1 = new JLabel( "何もしない", new ImageIcon(getClass().getResource("no_disposal_specified.gif")), SwingConstants.LEFT); **サンプルコード [#z30a391c] #code{{ JLabel label1 = new JLabel("何もしない ", new ImageIcon(getClass().getResource("no_disposal_specified.gif")), JLabel.LEFT); JLabel label2 = new JLabel("そのまま残す ", new ImageIcon(getClass().getResource("do_not_dispose.gif")), JLabel.LEFT); JLabel label3 = new JLabel("背景色でつぶす ", new ImageIcon(getClass().getResource("restore_to_background_color.gif")), JLabel.LEFT); JLabel label4 = new JLabel("直前の画像に戻す", new ImageIcon(getClass().getResource("restore_to_previous.gif")), JLabel.LEFT); JLabel label2 = new JLabel( "そのまま残す", new ImageIcon(getClass().getResource("do_not_dispose.gif")), SwingConstants.LEFT); JLabel label3 = new JLabel( "背景色で塗りつぶす", new ImageIcon(getClass().getResource("restore_to_background_color.gif")), SwingConstants.LEFT); JLabel label4 = new JLabel( "直前の画像に戻す", new ImageIcon(getClass().getResource("restore_to_previous.gif")), SwingConstants.LEFT); }} **解説 [#red85da1] Animated GIFで、次のコマを描画する時、直前の画像を異なる方法で消去するAnimated GIFファイルを作成し、これらをJLabelに貼り付けてアニメーションをテストしています。上記のように透過色を使用する場合、Swingでは、3番目の「背景色でつぶす」にしておかないと残像が出てしまうようです。 * 解説 [#explanation] `Animated GIF`で、次のコマを描画する時、直前の画像を異なる方法で消去する`Animated GIF`ファイルを作成し、これらを`JLabel`に貼り付けてアニメーションをテストしています。上記のように透過色を使用する場合、`Swing`では`3`番目の「背景色で塗りつぶす」にしておかないと残像が出てしまうようです。 -何もしない --No disposal specified. The decoder is not required to take any action. -そのまま残す --Do not dispose. The graphic is to be left in place. -背景色でつぶす --Restore to background color. The area used by the graphic must be restored to the background color. -直前の画像に戻す --Restore to previous. The decoder is required to restore the area overwritten by the graphic with what was there prior to rendering the graphic. - 何もしない > No disposal specified. The decoder is not required to take any action. **参考リンク [#z45d5419] -[[Cover Sheet for the GIF89a Specification>http://www.w3.org/Graphics/GIF/spec-gif89a.txt]] --23. Graphic Control Extension. の、iv) Disposal Method から説明を引用しています。 -[[Giam ダウンロードのページ>http://homepage3.nifty.com/furumizo/giamd.htm]] --Giamを使って、各Animated GIFを生成しています。 - そのまま残す > Do not dispose. The graphic is to be left in place. **コメント [#aa58fc4b] - Swing のバージョンを入れておいてもらえますか?現バージョンでも背景色でつぶすにしないと残像が残るんでしょうか? -- [[とおりすがり]] &new{2009-05-14 (木) 19:32:37}; - 背景色で塗りつぶす > Restore to background color. The area used by the graphic must be restored to the background color. - 直前の画像に戻す > Restore to previous. The decoder is required to restore the area overwritten by the graphic with what was there prior to rendering the graphic. * 参考リンク [#reference] - [https://www.w3.org/Graphics/GIF/spec-gif89a.txt Cover Sheet for the GIF89a Specification] -- `23. Graphic Control Extension.`の`iv) Disposal Method`から説明を引用 // - [http://homepage3.nifty.com/furumizo/giamd.htm Giam ダウンロードのページ] // -- `Giam`を使って、各`Animated GIF`を生成 * コメント [#comment] #comment - `Swing`のバージョンを入れておいてもらえますか?現バージョンでも背景色でつぶすにしないと残像が残るんでしょうか? -- &user(とおりすがり); &new{2009-05-14 (木) 19:32:37}; -- `Windows XP`で現バージョン(`1.5.0_18`, `1.6.0_14`, `1.7.0`)を実行してみましたが、同様だと思います。 -- &user(aterai); &new{2009-05-14 (木) 21:14:04}; #comment