Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ Trouble with images

Trouble with images

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Orik   USA  (182 posts)  Bio
Date Mon 15 Feb 2010 06:03 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 15 Feb 2010 06:07 AM (UTC)
Message
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"))



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 15 Feb 2010 06:09 AM (UTC)
Message
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 () 

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Orik   USA  (182 posts)  Bio
Date Reply #3 on Mon 15 Feb 2010 06:20 AM (UTC)

Amended on Mon 15 Feb 2010 06:22 AM (UTC) by Orik

Message
Thanks for the help Nick. I'm sure to have more questions.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,246 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.