[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Trouble with images

Trouble with images

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


Posted by Orik   USA  (182 posts)  [Biography] 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?
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] 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
[Go to top] top

Posted by Orik   USA  (182 posts)  [Biography] 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.
[Go to top] 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.


11,206 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]