[#5492] X Toolkit module — shugo@... (Shugo Maeda)
前田です。
16 messages
1997/12/01
[#5493] Re: X Toolkit module
— matz@... (Yukihiro Matsumoto)
1997/12/01
まつもと ゆきひろです
[#5503] Re: X Toolkit module
— shugo@... (Shugo Maeda)
1997/12/02
前田です。
[#5521] Re: X Toolkit module
— Noritsugu Nakamura <nnakamur@...>
1997/12/03
[#5532] Re: X Toolkit module
— shugo@... (Shugo Maeda)
1997/12/04
前田です。
[#5541] Re: X Toolkit module
— Noritsugu Nakamura <nnakamur@...>
1997/12/05
[#5543] Re: X Toolkit module
— shugo@... (Shugo Maeda)
1997/12/05
前田です。
[#5498] postscript — Kikutani Makoto <kikutani@...>
TkCanvasの
23 messages
1997/12/02
[#5499] Re: postscript
— matz@... (Yukihiro Matsumoto)
1997/12/02
まつもと ゆきひろです
[#5502] Re: postscript
— Kikutani Makoto <kikutani@...>
1997/12/02
きくたにです。
[#5535] wave viewer (Re: postscript)
— Kikutani Makoto <kikutani@...>
1997/12/05
きくたにです。
[#5536] Re: wave viewer (Re: postscript)
— Kikutani Makoto <kikutani@...>
1997/12/05
きくたにです。
[#5538] Re: wave viewer (Re: postscript)
— matz@... (Yukihiro Matsumoto)
1997/12/05
まつもと ゆきひろです
[#5547] Re: wave viewer (Re: postscript)
— Kikutani Makoto <kikutani@...>
1997/12/06
きくたにです。
[#5556] Re: wave viewer (Re: postscript)
— matz@... (Yukihiro Matsumoto)
1997/12/06
まつもと ゆきひろです
[#5574] tcltklib error (Re: wave viewer)
— Kikutani Makoto <kikutani@...>
1997/12/08
きくたにです。
[#5589] Re: tcltklib error (Re: wave viewer)
— Kikutani Makoto <kikutani@...>
1997/12/08
Mon, Dec 08, 1997 at 11:42:23AM +0900 において
[#5595] Re: tcltklib error (Re: wave viewer)
— Kikutani Makoto <kikutani@...>
1997/12/08
Mon, Dec 08, 1997 at 03:23:53PM +0900 において
[#5596] Re: tcltklib error (Re: wave viewer)
— WATANABE Hirofumi <watanabe@...>
1997/12/08
わたなべです.
[#5504] cgi-lib.rb — 青山 和光 <PXN11625@...>
cgi-lib.rb, shellwords.rb の新版です。
22 messages
1997/12/02
[#5505] Re: cgi-lib.rb
— matz@... (Yukihiro Matsumoto)
1997/12/03
まつもと ゆきひろです
[#5506] Re: cgi-lib.rb
— keiju@... (石塚圭樹 )
1997/12/03
けいじゅ@日本ラショナルソフトウェアです.
[#5508] Re: cgi-lib.rb
— matz@... (Yukihiro Matsumoto)
1997/12/03
まつもと ゆきひろです
[#5512] Re: cgi-lib.rb
— Shin-ichiro HARA <sinara@...>
1997/12/03
原です。
[#5513] nil =~ regexp (Re: cgi-lib.rb)
— matz@... (Yukihiro Matsumoto)
1997/12/03
まつもと ゆきひろです
[#5514] Re: nil =~ regexp (Re: cgi-lib.rb)
— Shin-ichiro HARA <sinara@...>
1997/12/03
原です。
[#5515] Re: nil =~ regexp (Re: cgi-lib.rb)
— matz@... (Yukihiro Matsumoto)
1997/12/03
まつもと ゆきひろです
[#5517] Re: nil =~ regexp (Re: cgi-lib.rb)
— Shin-ichiro HARA <sinara@...>
1997/12/03
原です。
[#5519] Re: nil =~ regexp (Re: cgi-lib.rb)
— matz@... (Yukihiro Matsumoto)
1997/12/03
まつもと ゆきひろです
[#5539] ruby 1.0-971204 released — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
25 messages
1997/12/05
[#5542] Re: ruby 1.0-971204 released
— Noritsugu Nakamura <nnakamur@...>
1997/12/05
[#5544] Re: ruby 1.0-971204 released
— shugo@... (Shugo Maeda)
1997/12/06
前田です。
[#5572] Re: ruby 1.0-971204 released
— Shoichi OZAWA <ozawa@...>
1997/12/08
こんにちは 小澤@日立 です。
[#5603] Re: ruby 1.0-971204 released
— Noritsugu Nakamura <nnakamur@...>
1997/12/08
[#5604] Re: ruby 1.0-971204 released
— WATANABE Hirofumi <watanabe@...>
1997/12/09
わたなべです.
[#5624] Re: ruby 1.0-971204 released
— Noritsugu Nakamura <nnakamur@...>
1997/12/10
[#5627] Re: ruby 1.0-971204 released
— matz@... (Yukihiro Matsumoto)
1997/12/11
まつもと ゆきひろです
[#5630] Re: ruby 1.0-971204 released
— WATANABE Hirofumi <watanabe@...>
1997/12/11
わたなべです.
[#5570] OSP'97 — WATANABE Hirofumi <watanabe@...>
わたなべです.
9 messages
1997/12/08
[#5578] cannot make GD-1.3 — Shoichi OZAWA <ozawa@...>
小澤@日立 です。
5 messages
1997/12/08
[#5607] megawidgets — Kikutani Makoto <kikutani@...>
きくたにです。
5 messages
1997/12/09
[#5615] bug in String#scan ?? — Yuji Shigehiro <sigehiro@...>
しげひろです.
17 messages
1997/12/10
[#5616] Re: bug in String#scan ??
— matz@... (Yukihiro Matsumoto)
1997/12/10
まつもと ゆきひろです
[#5617] Re: bug in String#scan ??
— Shin-ichiro HARA <sinara@...>
1997/12/10
原です。
[#5632] undef method — keiju@... (Keiju ISHITSUKA)
けいじゅ@日本ラショナルソフトウェアです.
6 messages
1997/12/11
[#5652] How to distinguish 1.1 or lower (was Re: bug in String#scan ??) — Eiji-usagi-MATSUmoto <ematsu@...>
うさぎです
6 messages
1997/12/12
[#5657] Is there alternative way? — KIMURA Koichi <kkimura@...>
5 messages
1997/12/12
[#5660] Re: [ruby-dev:1065] Re: Postgres module — Eiji-usagi-MATSUmoto <ematsu@...>
うさぎです
5 messages
1997/12/12
[#5668] Re: ObjectDBM — 青山 和光 <PXN11625@...>
石塚さん(B... さんですよね?)、おはようございます。
14 messages
1997/12/13
[#5672] Re: ObjectDBM
— keiju@... (石塚圭樹 )
1997/12/14
けいじゅ@日本ラショナルソフトウェアです.
[#5677] Re: ObjectDBM
— WATANABE Hirofumi <watanabe@...>
1997/12/15
わたなべです.
[#5686] uumerge.rb — Masaki Suketa <masaki.suketa@...>
sample に入っている uumerge.rb ですが
7 messages
1997/12/15
[#5701] get a password — tateishi@... (Takaaki TATEISHI)
立石@理科大です。
12 messages
1997/12/16
[#5704] Re: get a password
— Kikutani Makoto <kikutani@...>
1997/12/17
[#5718] Re: get a password
— matz@... (Yukihiro Matsumoto)
1997/12/18
まつもと ゆきひろです
[#5712] script to rewrite a pap-secrets — tateishi@... (Takaaki.Tateishi)
立石です。
1 message
1997/12/17
[#5732] ruby 1.1b2 released — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
12 messages
1997/12/19
[#5739] Re: ruby 1.1b2 released
— shugo@... (Shugo Maeda)
1997/12/20
前田です。
[#5751] ruby 1.1b3 released — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
11 messages
1997/12/24
[#5761] ruby 1.0-971225 released — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
6 messages
1997/12/25
[ruby-list:5669] Re: GD-0.4
From:
青山 和光 <PXN11625@...>
Date:
1997-12-13 23:41:57 UTC
List:
ruby-list #5669
とりあえず、大雑把に使い方も書いてみました。
ソースの順番に簡単なコメントを付けただけですが、間違いの訂正をして頂け
るでしょうか? その後でもう少し詳しい物を書こうと思います。
===== GD 拡張モジュールの使い方 =====
im = GD::Image.new(x_size, y_size) # 新規イメージ
im = GD::Image.newFromGif(gif_file_name) # gif ファイルから読み込む
im = GD::Image.newFronXbm(xbm_file_name) # xbm ファイルから読み込む
im = GD::Image.newFromGd(gd_file_name) # gd ファイルから読み込む
# もちろん、どれか1つにするか、別オブジェクトにしなければなりません。
im.destroy # イメージ破棄
color = im.colorAllocate(r, g, b) # その色を割り当てる
im.colorDeallocate(color) # その色の割り当て取消
color = im.colorClosest(r, g, b) # その色の割り当て保留
color = im.colorExact(r, g, b) # 既存の色から割り当てる
# 慎重な色割り当ての仕方はこんな感じかな。
color = im.colorExact(r, g, b) or
im.colorAllocate(r, g, b) or
im.colorClosest(r, g, b)
# と思ったら、nil ではなく -1 を返すので、これではだめなんですね。
im.colorsTotal # 全使用色数
color_name = im.getPixel(x, y) # そのポイントの色
im.rgb(color) # カラーテーブル --> RGB
im.trasparent(color) # その色を透明にする
im.setBrush(brush) # 筆の選択
blush = GD::Image.newFromGif(burush_file)
GD::Styled # (破)線
im.setStyle(color, color, ...) # (破)線のスタイルを定義
GD::Brushed # 筆
GD::StyledBrushed # 筆と(破)線
# 紅白線は、こんな感じ。
im.setStyle(red, white)
im.line(0, 0, 100, 0, GD::Styled)
im.setTile(tile) # 塗潰しのパターンの選択
tile = GD::Image.newFromGif(tile_file)
GD::Tiled # 塗潰しのパターン
GD::Transparent # 透明色
im.setPixel(x, y, color) # 1ピクセルの色変更
im.line(x1, y1, x2, y2, color) # 線を引く
im.dashedLine(x1, y1, x2, y2, color) # (破)線を引く
im.rectangle(x1, y1, x2, y2, color) # 長方形を描く
im.filledRectangle(x1, y1, x2, y2, color) # 中を塗潰した長方形を描く
im.polygon(polygon, color) # 多角形を描く
im.filledPolygon(polygon, color) # 中を塗潰した多角形を描く
# polygon は後述の Polygon オブジェクト。
im.arc(cx, cy, width, heihgt, start, end, color) # 円弧を描く
im.fill(x, y, color_name) # 塗潰す
im.fillToBorder(x, y, border_color, fill_color) # 縁線内を塗潰す
im.copy(im, x, y, sx, sy, sw, sh) # イメージを張り付ける
# もちろん im は別の Image オブジェクトでも良い。
# x, y の位置に、sx, sy, sw, sh の部分が張り付けられる。
im.copyResized(im, x, y, sx, sy, w, h, sw, sh) # リサイズして張り付ける
# x, y, w, h の範囲に sx, sy, sw, sh の範囲が張り付けられる。
im.string(font, x, y, string, color) # 文字列を書く
# font は後述の font オブジェクト。
im.stringUp(font, x, y, string, color) # 縦方向に文字列を書く
# 縦書きではない。単に90度回転した方向に書かれて行く。
im.char(font, x, y, string, color) # 文字を書く
im.charUP(font, x, y, string, color) # 縦方向に文字を書く
im.interlace # インターレースの状態
im.interlace = TRUE # インターレースにする
x_size, y_size = im.bounds # イメージの大きさ
x_size = im.width # イメージの横の大きさ
y_size = im.height # イメージの縦の大きさ
im.gif(OUT) # gif 形式での出力
im.gd(OUT) # gd 形式での出力
polygon = GD::Polygon.new # 多角形オブジェクトの生成
polygon.addPt(x, y) # 点(角) x, y を追加
x, y = polygon.getPt(n) # n 番目の点の位置
polygon.setPt(n, x, y) # n 番目の点を x, y に変更
polygon.deletePt(n) # n 番目の点を削除
all_points = polygon.length # 点の総数
xs = polygon.vertices # 各点の x 位置?
x1, y1, x2, y2 = polygon.bounds # 多角形の範囲
polygon.offset(vx, vy) # 多角形全体の移動
polygon.map(x1, y1, x2, y2) # 多角形全体のリサイズ
polygon.map(sx1, sy1, sx2, sy2, x1, y1, x2, y2) # 多角形の一部のリサイズ
# sx1, sy1, sx2, sy2 の範囲を x1, y1, x2, y2 の範囲に。(だと思うのですが)
font = GD::Font.new(font_name) # フォントオブジェクトの生成
# font_name : "Giant", "Small", "Large", "Medium", "Medium", "Tiny"
characters = font.nchars # フォントの文字数
first_character_no = font.offset # 最初の有効な文字の番号?
width = font.width # フォントの幅
height = font.height # フォントの高さ
青山 和光 Wakou Aoyama <pxn11625@niftyserve.or.jp>