Jump to content




[SOLVED] Can't load background image

api

2 replies to this topic

#1 Windows10User

  • Members
  • 62 posts
  • LocationC:\Minecraft\saves\stuff\computer

Posted 28 April 2018 - 07:05 PM

Background images (images as big as the terminal drawed at 1, 1) are also part of my GUI API, Graphics. The paintutils.drawImage() call doesn't seem to work, tho. It gives "graphics:232: bad argument #1 (expected table, got nil)".

Background image part of the API:
backgroundimg = {
   path = "",

   new = function(self)
	  local new = {}
	  setmetatable(new, {__index = self})
	  return new
   end,

   draw = function(self)
	  local image = paintutils.loadImage(self.path)
	  paintutils.drawImage(image, 1, 1) --line 232 AKA the error line
   end
}

Program used:
local fBCD = fs.open("Boot/bcd.ini", "r")
local bcd = textutils.unserialize(fBCD.readAll())
fBCD.close()

os.loadAPI("DoorOS/apis/graphics")

local splash = graphics.backgroundimg:new()
splash.path = "Boot/bootscreen.npf"
splash:draw()
read()

Edited by Windows10User, 01 May 2018 - 09:50 AM.


#2 Luca_S

  • Members
  • 387 posts
  • LocationGermany

Posted 28 April 2018 - 08:28 PM

At first glance I think this might be the same problem you had here

#3 Windows10User

  • Members
  • 62 posts
  • LocationC:\Minecraft\saves\stuff\computer

Posted 29 April 2018 - 08:43 AM

OK, I'll try with a more recent copy of CC 1.80.

EDIT: It doesn't do anything. Still the same error.

EDIT 2: Looks like I spelled the image's extension wrong. Sorry 4 wasting your time, everyone.

Edited by Windows10User, 29 April 2018 - 08:50 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users