font = GD::Font.new('Large') im.string(font, 50, 50, "String", blue) im.string(GD::Font::LargeFont, 50, 100, "String", red)
im.line(50, 50, 150, 50, black)
im.dashedLine(50, 50, 150, 50, blue)
im.rectangle(50, 50, 150, 150, blue)
im.filledRectangle(50, 50, 150, 150, blue)
poly = GD::Polygon.new poly.addPt(100,50) poly.addPt(50,100) poly.addPt(150,100) im.polygon(poly, blue)
poly = GD::Polygon.new poly.addPt(100,50) poly.addPt(50,100) poly.addPt(150,100) im.filledPolygon(poly, blue)
im.arc(100, 50, 100, 50, 0, 270, blue) im.arc(100, 150, 100, 50, 90, 360, red)
im.arc(100, 50, 100, 50, 0, 360, blue) im.fill(100, 50, red) im.arc(100, 150, 100, 50, 0, 360, blue) im.fill(100, 150, green)
im.arc(100, 50, 100, 50, 0, 360, blue) im.fill(100, 50, red) im.arc(100, 150, 100, 50, 0, 360, blue) im.fill(100, 190, green)
im.arc(100, 50, 100, 50, 0, 360, blue) im.fillToBorder(100, 50, blue, red)
im.arc(100, 50, 100, 50, 0, 360, blue) im.fillToBorder(100, 50, green, white)
im.filledRectangle(0, 0, 50, 50, red) im.filledRectangle(50, 0, 100, 50, green) im.filledRectangle(0, 50, 50, 100, blue) im.filledRectangle(50, 50, 100, 100, yellow) im.copy(im, 100, 100, 0, 0, 50, 50)
im.colorAllocate(255,255,255) im.colorAllocate(255,0,0) im2.filledRectangle(0, 0, 50, 50, red) im2.filledRectangle(50, 0, 100, 50, green) im2.filledRectangle(0, 50, 50, 100, blue) im2.filledRectangle(50, 50, 100, 100, yellow) im.copy(im2, 100, 100, 0, 0, 50, 50)
im.filledRectangle(0, 0, 50, 50, red) im.filledRectangle(50, 0, 100, 50, green) im.filledRectangle(0, 50, 50, 100, blue) im.filledRectangle(50, 50, 100, 100, yellow) im.copyResized(im, 100, 100, 0, 0, 30, 30, 50, 50)