Changes between Version 11 and Version 12 of IconTutorial


Ignore:
Timestamp:
Dec 29, 2007, 1:15:31 PM (17 years ago)
Author:
cinc
Comment:

Command explanantion

Legend:

Unmodified
Added
Removed
Modified
  • IconTutorial

    v11 v12  
    199199
    200200As expected clicking the '''Repaint''' button will not show a new image because the necessary paint commands referencing the new image are missing.
     201
     202The necessary commands are shown below.
     203
     204
     205{{{
     206   Key name:             CairoCommands
     207   Data:                 <ctxt>save</><transl>0 0.2</><scale>0.01 0.01</><imgkey>OverlayImage # 1</><ctxt>restore</>
     208                         <ctxt>save</><transl>0.4 0.3</><scale>0.01 0.01</><imgkey>OverlayImage2 # 1</><ctxt>restore</>
     209}}}
     210
     211
     212[[Image(source:/icon_tutorial/multimedia_folder.png, nolink)]] [[Image(source:/icon_tutorial/multimedia_folder_small.png, nolink)]]
     213
     214==== Additional commands in detail ====
     215
     216{{{ 
     217<transl>x y</>:
     218
     219   Specify the position for the next paint command.
     220}}}
     221
     222''X'' and ''y'' specify the position on the surface where subsequent painting will take place. 0.0 0.0 is the upper left corner. The values may run from 0.0 to 1.0.
     223
     224----
     225
     226The resulting icon shows that images are drawn in the order they are described in the painting commands. Thus the speaker image (!OverlayImage2) is painted on the very top.
     227
     228Each of the image commands is surounded by ''<ctxt>save</>'' and ''<ctxt>restore</>''. This facilitates correct scaling and positioning. An example shows this.
     229
     230{{{
     231   Key name:             CairoCommands
     232   Data:                 <ctxt>save</><transl>0 0.2</><scale>0.01 0.01</><imgkey>OverlayImage # 1</>
     233                                      <transl>0.4 0.3</><scale>0.01 0.01</><imgkey>OverlayImage2 # 1</><ctxt>restore</>
     234}}}
     235
     236Using only one block of context save commands (which is pointless because no further painting is done) yields the following icon.
     237