Interface address
http://gmapi.liulikeji.top:15842/image
Request format: httppost
Enter: json
parameter:
URL (file download link)
h (height)
W (length)
*Note: The size of the picture is displayed in the CC, usually the height of the CC terminal size X3 width X2
local w, h = term.getsize ()local w = w*2
local h = h*3
Format (mode)
Lua output a LUA executable file (1FPS) Press the car to closeRAW output image/video file based on RAW mode (default videos)
Blit-IMAGE output image/animation file in Blit image (BIMG) format
32VID output image/animation file in Blit image (BIMG) format
Return: Type: String (File Download Link)
http://fserverikeji.top:15848/wavfile/ {ID }.image
Example 1:
Play: Show https://www.mcmod.cn/images/logo.gif
local imageurl = "https://www.mcmod.cn/images/logo.gif"Example 2:local w, h = term.getsize ()
local w = w*2
local h = h*3
local format = "lua"
LOCAL JSON = Textutils.Serialisejson ({["url"] = Imageurl, ["w"] = w, ["h" = h, ["format"] = format})
local luaurl = http.post ("http://gmapi.liulikeji.top:15842/image", json). READALL ()
load (http.get (luaurl). READALL ()) ()
Image browser
cmd = {...}local imageurl = cmd [1]
if cmd [2] == "Monitor" then
Peripheral.find ("Monitor"). SettextScale (0.5)
W, h = Peripheral.find ("Monitor"). Getsize ()
else
W, h = term.getsize ()
end
local w = w*2
local h = h*3
local format = "lua"
LOCAL JSON = Textutils.Serialisejson ({["url"] = Imageurl, ["w"] = w, ["h" = h, ["format"] = format})
local luaurl = http.post ("http://gmapi.liulikeji.top:15842/image", json). READALL ()
if cmd [2] == "Monitor" then
Localterm = Term
Term.ReDirect (Peripheral.find ("Monitor"))
Load (http.get (luaurl). READALL ()) () () ())
Peripheral.find ("Monitor"). SettextScale (1)
else
Load (http.get (luaurl). READALL ()) () () ())
end
Attached::
Online file storage: Liulikeji.top (liulikeji.top)