From WikiChip
Editing mirc/picture windows
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | {{ | + | {{mIRC Guide}} |
'''Picture Windows''' in [[mIRC]] are a special type of [[Custom windows - mIRC|custom windows]] that is used as a drawing canvas. mIRC provides a set of [[list of commands - mIRC|commands]], [[list of identifiers - mIRC|identifiers]], and [[on events - mIRC|events]] for manipulating them. Picture windows provide an alternative mean of creating a graphical user interface. | '''Picture Windows''' in [[mIRC]] are a special type of [[Custom windows - mIRC|custom windows]] that is used as a drawing canvas. mIRC provides a set of [[list of commands - mIRC|commands]], [[list of identifiers - mIRC|identifiers]], and [[on events - mIRC|events]] for manipulating them. Picture windows provide an alternative mean of creating a graphical user interface. | ||
− | == Creating a | + | == Creating a window == |
− | Picture windows can be created via the {{mIRC|/window}} command in combination with the -p switch | + | Picture windows can be created via the {{mIRC|/window}} command in combination with the -p switch. |
− | '''Note:''' -p only creates the | + | '''Note:''' -p only creates the canvas, the size used in /window will by default set the window's size, to sets the size of the canvas, you need to use the -f switch, which will automatically resize the size of the window for you. |
− | '''Note 1:''' | + | '''Note 1:''' The only way to get a window canvas/size bigger than your actual maximum screen resolution is to open the window once using the switches +Lt and then call /window -f again with the actual width and height. |
A simple example: | A simple example: | ||
Line 15: | Line 15: | ||
</source> | </source> | ||
− | will create a desktop picture window named <code>@example</code> with an editbox and a size of 500x400, the actual size of the | + | will create a desktop picture window named <code>@example</code> with an editbox and a size of 500x400, the actual size of the canvas is not 500*400, it will be close, you can check its size with: <source lang="mIRC"> |
//echo -a $window(@example).bw $window(@example).bh | //echo -a $window(@example).bw $window(@example).bh | ||
</source> | </source> | ||
Line 25: | Line 25: | ||
</source> | </source> | ||
− | Now the | + | Now the canvas has the desired size. |
== Drawing == | == Drawing == | ||
Line 45: | Line 45: | ||
'''{{mIRC|/drawtext}}''' can be used to draw text at the specified coordinate, using the specified font name and font size, it supports basic formating via switches. | '''{{mIRC|/drawtext}}''' can be used to draw text at the specified coordinate, using the specified font name and font size, it supports basic formating via switches. | ||
− | '''{{mIRC|/drawsave}}''' which actually can't be used to draw to a | + | '''{{mIRC|/drawsave}}''' which actually can't be used to draw to a canvas, is used to save an area to a .bmp or .jpg file. |
'''{{mIRC|/drawscroll}}''' can be used to scroll an area inside rectangles by specific distances, you can specify more than one set of scrolling area and distances. | '''{{mIRC|/drawscroll}}''' can be used to scroll an area inside rectangles by specific distances, you can specify more than one set of scrolling area and distances. | ||
Line 67: | Line 67: | ||
drawdot -r @test 255 5 50 50 | drawdot -r @test 255 5 50 50 | ||
;draw a red line size = 3, first point = 25 50, second point 75 50 | ;draw a red line size = 3, first point = 25 50, second point 75 50 | ||
− | .timer 1 | + | .timer 1 12 drawline -r @test 255 3 25 50 75 50 |
;draw a non filled red rectangle, size = 8, x y w h = 25 25 75 75 | ;draw a non filled red rectangle, size = 8, x y w h = 25 25 75 75 | ||
− | .timer 1 | + | .timer 1 24 drawrect -r @test 255 8 25 25 75 75 |
;fill the whole window with a border fill: as long as the starting pixel(0 0)'s color isn't the border color (255), that pixel is made the filling color (rgb = 12345, green) | ;fill the whole window with a border fill: as long as the starting pixel(0 0)'s color isn't the border color (255), that pixel is made the filling color (rgb = 12345, green) | ||
− | .timer 1 | + | .timer 1 36 drawfill -r @test 1234567 255 0 0 |
;draw "test" in rgb color 65498, at coordinate 65 65, font name verdana and font size 12 | ;draw "test" in rgb color 65498, at coordinate 65 65, font name verdana and font size 12 | ||
− | .timer 1 | + | .timer 1 48 drawtext -r @test 65498 verdana 12 65 65 test |
;scroll the whole window, by 30 pixels on the right, and 20 pixels upward | ;scroll the whole window, by 30 pixels on the right, and 20 pixels upward | ||
− | .timer 1 | + | .timer 1 60 drawscroll @test 30 -20 0 0 300 300 |
;copy the rectangle '50 50 100 100' at coordinate '200 60' | ;copy the rectangle '50 50 100 100' at coordinate '200 60' | ||
− | .timer 1 | + | .timer 1 72 drawcopy @test 50 50 100 100 @test 200 60 |
;rotate the whole window by 12° | ;rotate the whole window by 12° | ||
− | .timer 1 | + | .timer 1 84 drawrot -m @test 12 |
;replace all the pixel with the rgb color 255 by the rgb color 6598743 | ;replace all the pixel with the rgb color 255 by the rgb color 6598743 | ||
− | .timer 1 | + | .timer 1 96 drawreplace -r @test 255 6598743 |
} | } | ||
</source> | </source> | ||
− | + | Resulting in | |
− | + | [[File:Draw*.gif|thumbnail|draw*]] | |
− | |||
− | [[File: | ||
== Mouse Events == | == Mouse Events == | ||
− | Mouse events can be defined in a {{mIRC| | + | Mouse events can be defined in a {{mIRC|Custom Windows#Custom Window's Menu|script menu definition}}, a picture window support the following mouse events: |
* '''mouse''' - mouse moved at a new coordinate, you can check {{mIRC|$mouse|$mouse.x}} and {{mIRC|$mouse|$mouse.y}} to get the new coordinate of the mouse. | * '''mouse''' - mouse moved at a new coordinate, you can check {{mIRC|$mouse|$mouse.x}} and {{mIRC|$mouse|$mouse.y}} to get the new coordinate of the mouse. | ||
Line 102: | Line 100: | ||
* '''drop''' - mouse drag and dropped at {{mIRC|$mouse|$mouse.x}} {{mIRC|$mouse|$mouse.y}}. | * '''drop''' - mouse drag and dropped at {{mIRC|$mouse|$mouse.x}} {{mIRC|$mouse|$mouse.y}}. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[Category:mIRC | + | [[Category:mIRC]] |