Trouble with images

Posted by Orik on Mon 15 Feb 2010 06:03 AM — 4 posts, 16,730 views.

USA #0
Ok. I am trying to load an image but it's not working. I just get a lightgrey box.


require "movewindow"

win = GetPluginID ()  -- get a unique name
WindowCreate (win, 0, 0, 200, 200, 12, 0, ColourNameToRGB("lightgrey")) -- create window
--WindowCreate (win, 0, 0, 200, 200, 12, 0, 0) -- create window


WindowLoadImage (win, "im1", "C:\Program Files\MUSHclient\worlds\images\scroll.bmp")
WindowDrawImage (win, "im1", 1, 1, 40, 40, 1)

  -- find where window was last time
  windowinfo = movewindow.install (win, 7)

  -- let them move it around                 
  movewindow.add_drag_handler (win, 0, 0, 0, 0)


WindowShow (win,  true)  -- show it 


I'm just testing to see how to put images in, but haven't been able to do it yet.

Also, the grey box will go behind two plugins, but won't go behind a third. How do I make it go behind all the other miniwindows?
Australia Forum Administrator #1
I'm concerned you are not doubling your backslashes, since they are quoted Lua strings.

eg.


WindowLoadImage (win, "im1", "C:\\Program Files\\MUSHclient\\worlds\\images\\scroll.bmp")


You can also see if the functions are failing (eg. file not found) like this:


check (WindowLoadImage (win, "im1", "C:\\Program Files\\MUSHclient\\worlds\\images\\scroll.bmp"))


Australia Forum Administrator #2
Orik said:

Also, the grey box will go behind two plugins, but won't go behind a third. How do I make it go behind all the other miniwindows?


The windows are drawn in window ID order, so the lower the ID, the sooner it is drawn (and therefore, the further to the back).

To make something a long way back, put something like a space at the front of the window ID, eg.


win = " " .. GetPluginID () 
USA #3
Thanks for the help Nick. I'm sure to have more questions.