CmdScale
From MCS Wiki AVR
(Difference between revisions)
(Created page with "= <span class="f_Header">Action</span> = Apply a scale to the current matrix. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span...") |
|||
Line 41: | Line 41: | ||
= <span class="f_Header">Example</span> = | = <span class="f_Header">Example</span> = | ||
+ | |||
+ | <source lang="bascomavr"> | ||
+ | ' Pseudocode | ||
+ | |||
+ | ' To zoom a bitmap 2X | ||
+ | Begin_G BITMAPS | ||
+ | CmdLoadIdentity | ||
+ | CmdScale 2 * 65536, 2 * 65536 | ||
+ | CmdSetMatrix | ||
+ | Vertex2II 68, 28, 0, 0 | ||
+ | </source> [[File:Clip0048.png|center|Clip0048.png]] <source lang="bascomavr"> | ||
+ | ' To zoom a bitmap 2X around its center | ||
+ | Begin_G BITMAPS | ||
+ | CmdLoadIdentity | ||
+ | CmdTranslate 65536 * 32, 65536 * 32 | ||
+ | CmdScale 2 * 65536, 2 * 65536 | ||
+ | CmdTranslate 65536 * -32, 65536 * -32 | ||
+ | CmdSetMatrix | ||
+ | Vertex2II 68, 28, 0, 0 | ||
+ | </source> [[File:Clip0049.png|center|Clip0049.png]] | ||
+ | |||
+ | <br/>{{Languages}} | ||
+ | |||
+ | [[Category:FT800 Commands]] |
Latest revision as of 19:47, 12 December 2014
Contents |
Action
Apply a scale to the current matrix.
Syntax
CmdScale sx, sy
Remarks
sx |
x scale factor, in signed 16. 16 bit fixed-point form |
sy |
y scale factor, in signed 16. 16 bit fixed-point form |
Example
' Pseudocode ' To zoom a bitmap 2X Begin_G BITMAPS CmdLoadIdentity CmdScale 2 * 65536, 2 * 65536 CmdSetMatrix Vertex2II 68, 28, 0, 0
' To zoom a bitmap 2X around its center Begin_G BITMAPS CmdLoadIdentity CmdTranslate 65536 * 32, 65536 * 32 CmdScale 2 * 65536, 2 * 65536 CmdTranslate 65536 * -32, 65536 * -32 CmdSetMatrix
Vertex2II 68, 28, 0, 0
Languages | English |
---|