{"id":457,"date":"2004-02-14T10:07:50","date_gmt":"2004-02-14T01:07:50","guid":{"rendered":"\/?p=457"},"modified":"2004-02-14T10:07:50","modified_gmt":"2004-02-14T01:07:50","slug":"alpha-channel","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/457.html","title":{"rendered":"alpha-channel"},"content":{"rendered":"<p>\n\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u306a\u304f\u3059\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u3044\u305f\u304c\u3001\u3046\u307e\u304f\u3044\u304b\u305a\u900f\u904ePNG\u3092\u4f7f\u3046\u3053\u3068\u3067\u89e3\u6c7a\u3092\u3057\u305f\u3002\u900f\u904ePNG\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001GIMP for Windows \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002GIMP\u306fPhotoshop\u306a\u3069\u3068\u64cd\u4f5c\u4f53\u7cfb\u304c\u5fae\u5999\u306b\u9055\u3046\u306e\u3067\u3001\u3069\u3046\u3084\u3063\u3066\u900f\u904ePNG\u3092\u4f5c\u308c\u3070\u3088\u3044\u304b\u3061\u3087\u3063\u3068\u60a9\u3080\u3002\n<\/p>\n<p>\n\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u30a2\u30eb\u30d5\u30a1\u30c1\u30e3\u30f3\u30cd\u30eb\u3067\u3001[\u753b\u50cf]-[\u30e2\u30fc\u30c9]-[RGB]\u3068\u30ab\u30e9\u30fc\u30e2\u30fc\u30c9\u306b\u3057\u3066\u304b\u3089\u3001[\u753b\u50cf]-[\u30a2\u30eb\u30d5\u30a1]-[\u30a2\u30eb\u30d5\u30a1\u30c1\u30e3\u30f3\u30cd\u30eb\u3092\u8ffd\u52a0]\u3068\u3057\u3066\u900f\u660e\u306b\u3059\u308b\u90e8\u5206\u3092\u6307\u5b9a\u3059\u308b\u305f\u3081\u306e\u30c1\u30e3\u30f3\u30cd\u30eb\u3092\u8ffd\u52a0\u3059\u308b\u3002\u900f\u904e\u3057\u305f\u3044\u90e8\u5206\u3092\u9078\u629e\u3057\u3066\u304b\u3089\u3001[\u7de8\u96c6]-[\u6d88\u53bb]\u3068\u3059\u308c\u3070\u900f\u904e\u90e8\u5206\u304c\u3067\u304d\u3042\u304c\u308b\u3002\u5f8c\u306f\u3001[\u5225\u540d\u4fdd\u5b58]\u3067PNG\u5f62\u5f0f\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3059\u308c\u3070\u3044\u3044\u3002\n<\/p>\n<p>\nJava\u3067\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u306e\u306fJava2\u304b\u3089\u306f\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u3092\u3069\u3046\u305e\u3002\n<\/p>\n<p><!--more--><\/p>\n<div class=\"code\">package org.sssg.four.java.mousecursor;<br \/>\nimport java.awt.Cursor;<br \/>\nimport java.awt.Image;<br \/>\nimport java.awt.Point;<br \/>\nimport java.awt.Toolkit;<br \/>\nimport javax.swing.JFrame;<\/p>\n<p>public class Starter {<br \/>\n\tpublic static void main(String[] args) {<br \/>\n\t\tString s = &#8220;resource\/cursor.png&#8221;;<br \/>\n\t\tJFrame frame = new JFrame(&#8220;Original Cursor Frame&#8221;);<br \/>\n\t\tframe.setSize(200, 100);<br \/>\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br \/>\n\t\ttry {<br \/>\n\t\t\tImage cursorImage = Toolkit.getDefaultToolkit().getImage(s);<br \/>\n\t\t\tPoint hotSpot = new Point(12, 12);<br \/>\n\t\t\tCursor cursor =<br \/>\n\t\t\t\tToolkit.getDefaultToolkit().createCustomCursor(<br \/>\n\t\t\t\t\tcursorImage,<br \/>\n\t\t\t\t\thotSpot,<br \/>\n\t\t\t\t\t&#8220;original cursor&#8221;);<br \/>\n\t\t\tframe.setCursor(cursor);<br \/>\n\t\t} catch (java.lang.IndexOutOfBoundsException e) {<br \/>\n\t\t\tSystem.out.println(&#8220;Can&#8217;t create such big custome cursor&#8221;);<br \/>\n\t\t} catch (java.awt.HeadlessException e) {<br \/>\n\t\t\tSystem.out.println(&#8220;Can&#8217;t create custome cursor&#8221;);<br \/>\n\t\t} catch (Exception e) {<br \/>\n\t\t\tSystem.out.println(&#8220;Can&#8217;t load custome cursor:&#8221; + e);<br \/>\n\t\t}<br \/>\n\t\tframe.setVisible(true);<br \/>\n\t}<br \/>\n}<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u306a\u304f\u3059\u65b9\u6cd5\u3092\u8abf\u3079\u3066\u3044\u305f\u304c\u3001\u3046\u307e\u304f\u3044\u304b\u305a\u900f\u904ePNG\u3092\u4f7f\u3046\u3053\u3068\u3067\u89e3\u6c7a\u3092\u3057\u305f\u3002\u900f\u904ePNG\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001GIMP for Windows \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002GIMP\u306fPhotoshop\u306a\u3069\u3068\u64cd\u4f5c &hellip; <a href=\"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/457.html\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-etc"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":0,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}