im = GD::Image.new(200, 200) im.png STDOUT
file = open("image_newfromxpm.png", "rb") im = GD::Image.newFromPng(file) file.close im.png STDOUT
file = open("image_newfromxpm.jpeg", "rb") im = GD::Image.newFromJpeg(file) file.close im.png STDOUT
file = open("image_newfromxbm.xbm", "rb") im = GD::Image.newFromXbm(file) file.close im.png STDOUT
file = open("image_newfromxpm.xpm", "rb") im = GD::Image.newFromXpm(file) file.close im.png STDOUT
file = open("image_newfromgd.gd", "rb") im = GD::Image.newFromGd(file) file.close im.png STDOUT
file = open("image_newfromgd2.gd2", "rb") im = GD::Image.newFromGd2(file) file.close im.png STDOUT
file = open("image_newfromgd2.gd2", "rb") im = GD::Image.newFromGd2Part(file, 0, 20, 30, 50) file.close im.png STDOUT
STDERR.print im.interlace, "\n" im.interlace = TRUE STDERR.print im.interlace, "\n"
false true
im = GD::Image.new(200, 300) w, h = im.bounds STDERR.print "width: ", w, " height: ", im.height, "\n" STDERR.print "width: ", im.width, "\n" STDERR.print "height: ", im.height, "\n"
width: 200 height: 300 width: 200 height: 300
im = GD::Image.new(200, 300) STDERR.print "im.boundsSafe(100, 100): ", im.boundsSafe(100, 100), "\n" STDERR.print "im.boundsSafe(300, 300): ", im.boundsSafe(300, 300), "\n"
im.boundsSafe(100, 100): true im.boundsSafe(300, 300): false
im = GD::Image.new(200, 200) im.png STDOUT
im = GD::Image.new(200, 200) im.jpeg STDOUT, 0
im = GD::Image.new(200, 200) im.gd STDOUT
#define GD2_CHUNKSIZE 128 #define GD2_CHUNKSIZE_MIN 64 #define GD2_CHUNKSIZE_MAX 4096 #define GD2_FMT_RAW 1 #define GD2_FMT_COMPRESSED 2となっていた。
im = GD::Image.new(200, 200) im.gd2 STDOUT, 64, 2
im = GD::Image.new(200, 200) white = im.colorAllocate(255,255,255) black = im.colorAllocate(0,0,0) im.wbmp white, STDOUT