initial commit
[rofl0r-KOL.git] / main_ticon.htm
blob3f88172c07b99443234147ca26e5738ad2c3606c
1 <html>
2 <head>
3 <title>KOL Help: TIcon object (main frame)</title>
4 <base target="_top">
5 </head>
7 <body bgcolor="#FFFFEF" text="#000000" link="#008080" vlink="#008000" alink="#808000">
8 <p><font face="Courier" color="#800080"><b>TIcon( unit <a href=kol_pas.htm>KOL.pas</a> )
9 <font face="Wingdings">ï</font> <a href=tobj.htm>TObj</a>
10 <font face="Wingdings">ï</font> <a href=_tobj.htm>_TObj</a>
11 </b></font></p>
12 <p><b>
13 TIcon = object( <a href=tobj.htm target="_top">TObj</a> )
14 </b></p>
15 Object type to incapsulate icon or cursor image.
16 <h3 align="center"><font color="#FF8080">TIcon properties</font></h3>
17 <a name="size"></a>
18 <p>
19 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Size</b></font>: <b>Integer</b>;</font>
20 <br>
21 Icon dimension (width and/or height, which are equal to each other always).
22 </p>
23 <a name="handle"></a>
24 <p>
25 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Handle</b></font>: HIcon;</font>
26 <br>
27 Windows icon object handle.
28 </p>
29 <a name="empty"></a>
30 <p>
31 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Empty</b></font>: <b>Boolean</b>;</font>
32 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
33 <br>
34 Returns True if icon is Empty.
35 </p>
36 <a name="shareicon"></a>
37 <p>
38 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>ShareIcon</b></font>: <b>Boolean</b>;</font>
39 <br>
40 True, if icon object is shared and can not be deleted when TIcon object
41 is destroyed (set this flag is to True, if an icon is obtained from another
42 TIcon object, for example).
43 </p>
44 <a name="hotspot"></a>
45 <p>
46 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>HotSpot</b></font>: TPoint;</font>
47 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#209;</font>&nbsp;&nbsp;&nbsp;
48 <br>
49 Hot spot point - for cursors.
50 </p>
51 <h4 align="center"><font color="black">Properties, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
52 <h3 align="center"><font color="#FF8080">TIcon methods</font></h3>
53 <a name="clear"></a>
54 <p>
55 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Clear</b></font>;</font>
56 <br>
57 Clears icon, freeing image and allocated GDI resource (<a href=#handle target="main">Handle</a>).
58 </p>
59 <a name="draw"></a>
60 <p>
61 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>Draw</b></font>( DC: HDC; X, Y: <b>Integer</b> );</font>
62 <br>
63 Draws icon onto given device context. Icon always is drawn transparently
64 using its transparency mask (stored internally in icon object).
65 </p>
66 <a name="stretchdraw"></a>
67 <p>
68 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>StretchDraw</b></font>( DC: HDC; Dest: TRect );</font>
69 <br>
70 Draws icon onto given device context with stretching it to fit destination
71 rectangle. See also <a href=#draw target="main">Draw</a>.
72 </p>
73 <a name="loadfromstream"></a>
74 <p>
75 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LoadFromStream</b></font>( Strm: PStream );</font>
76 <br>
77 Loads icon from stream. If stream contains several icons (of
78 different dimentions), icon with the most appropriate size is loading.
79 </p>
80 <a name="loadfromfile"></a>
81 <p>
82 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LoadFromFile</b></font>( <b>const</b> FileName: <b>String</b> );</font>
83 <br>
84 Load icon from file. If file contains several icons (of
85 different dimensions), icon with the most appropriate size is loading.
86 </p>
87 <a name="loadfromresourceid"></a>
88 <p>
89 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LoadFromResourceID</b></font>( Inst: <b>Integer</b>; ResID: <b>Integer</b>; DesiredSize: <b>Integer</b> );</font>
90 <br>
91 Loads icon from resource. To load system default icon, pass 0 as Inst and
92 one of followin values as ResID:
93 <pre>
94 IDI_APPLICATION Default application icon.
95 IDI_ASTERISK Asterisk (used in informative messages).
96 IDI_EXCLAMATION Exclamation point (used in warning messages).
97 IDI_HAND Hand-shaped icon (used in serious warning messages).
98 IDI_QUESTION Question mark (used in prompting messages).
99 IDI_WINLOGO Windows logo.
100 </pre> It is also possible to load icon from resources of another module,
101 if pass instance handle of loaded module as Inst parameter.
102 </p>
103 <a name="loadfromresourcename"></a>
105 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LoadFromResourceName</b></font>( Inst: <b>Integer</b>; ResName: <b>PChar</b>; DesiredSize: <b>Integer</b> );</font>
106 <br>
107 Loads icon from resource. To load own application resource, pass
108 hInstance as Inst parameter. It is possible to load resource from
109 another module, if pass its instance handle as Inst.
110 </p>
111 <a name="loadfromexecutable"></a>
113 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>LoadFromExecutable</b></font>( <b>const</b> FileName: <b>String</b>; IconIdx: <b>Integer</b> );</font>
114 <br>
115 Loads icon from executable (exe or dll file). Always default sized icon
116 is loaded. It is possible also to get know how much icons are contained
117 in executable using gloabl function <a href=kol_pas.htm#getfileiconcount target="_top">GetFileIconCount</a>. To obtain icon of
118 another size, try to load given executable and use <a href=#loadfromresourceid target="main">LoadFromResourceID</a>
119 method.
120 </p>
121 <a name="savetostream"></a>
123 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SaveToStream</b></font>( Strm: PStream );</font>
124 <br>
125 Saves single icon to stream. To save icons with several different
126 dimensions, use global procedure <a href=kol_pas.htm#saveicons2stream target="_top">SaveIcons2Stream</a>.
127 </p>
128 <a name="savetofile"></a>
130 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>SaveToFile</b></font>( <b>const</b> FileName: <b>String</b> );</font>
131 <br>
132 Saves single icon to file. To save icons with several different
133 dimensions, use global procedure <a href=kol_pas.htm#saveicons2file target="_top">SaveIcons2File</a>.
134 </p>
135 <a name="convert2bitmap"></a>
137 <font face="Courier" color="#800080"><b>function</b> <font color="#808000"><b>Convert2Bitmap</b></font>( TranColor: TColor ): HBitmap;</font>
138 <br>
139 Converts icon to bitmap, returning Windows GDI bitmap resource as
140 a result. It is possible later to assign returned bitmap handle to
141 <a href=#handle target="main">Handle</a> property of <a href=tbitmap.htm target="_top">TBitmap</a> object to use features of <a href=tbitmap.htm target="_top">TBitmap</a>.
142 Pass TranColor to replace transparent area of icon with given color.
143 </p>
144 <h4 align="center"><font color="black">Methods, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
145 <h3 align="center"><font color="#FF8080">TIcon events</font></h3>
146 <h4 align="center"><font color="black">Events, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
147 <h3 align="center"><font color="#FF8080">TIcon fields</font></h3>
148 <h4 align="center"><font color="black">Fields, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
149 <hr>
150 <p align="center">[&nbsp;<a href=index.htm>Index</a>&nbsp;]</p>
151 <p align="center"><font face="Comic Sans MS"><small>This help is generated 22-Sep-2005 by KOL Help generator, (C) 2000-2001 by Vladimir Kladov<br>Modified (C) 2003 by Alexander Bartov</small></font></p>
152 </body>
153 </html>