- 2008年5月 7日 01:05
- php
phpのGDライブラリは何かと便利。
あんまりphpは触る機会がないので、とりあえずよく使うところをメモメモ。
// 空のイメージリソースを作成
int imagecreate ( int x_size, int y_size )
// 使用する色を生成(最初の呼び出しは背景色)
int imagecolorallocate ( resource image, int red, int green, int blue )
int imagesx ( resource image ) // 横サイズ
int imagesy ( resource image ) // 縦サイズ
// ファイルよりイメージリソースの作成
int imagecreatefrom■■■( string filename )
■■■ = gif, jpeg, png, wbmp, string など
// ブラウザ又はファイルへ画像を出力
bool image■■■( resource image [, string filename] )
■■■ = gif, jpeg, png, wbmp
// 画像の一部をコピー、伸縮する dst がコピー先、src がコピー元の画像
bool imagecopyresampled ( resource dst_image, resource src_image, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h )
- Newer: 夏の教室
- Older: Flash Lite 1.1 memorandum