Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: lennyitb on July 24, 2014, 07:13:00 pm

Title: Drawing a picture
Post by: lennyitb on July 24, 2014, 07:13:00 pm
I have been working at figuring out and researching how to draw a picture larger than 8x8 in axe, for example this one:
Spoiler For Spoiler:
FFFFF000015066152221752205622254225537720000044011549935555528913800008244582AA582CA39A80982615F80D4
which by the way is 20x20. What I've been doing is this:
Code: [Select]
:[(picture)]->Pic1
:Pt-On(1,1,Pic1)
:0->K
:While K=0
:getKey->K
:End
:Return
And if it wasn't clear, (picture) is to be replaced with the actual picture. So what have I been doing wrong? -Lennyitb
Title: Re: Drawing a picture
Post by: Runer112 on July 24, 2014, 07:28:21 pm
The simple way is to draw it using the Bitmap() (http://axe.eeems.ca/Commands.html#spritesCommands) command, for which you specify the specify the sprite's dimensions by putting its width (1 byte) followed by its height (1 byte) at the start of the sprite data. You can either insert these at the start of the hexadecimal sprite data (in hexadecimal), or if you want to enter the size in decimal numbers, the following would be equivalent:

Code: [Select]
Data(20,20)→Pic1
[(picture)]

Note that each row of image data must be padded on the end with zero bits such that each row takes up a whole number of bytes; in the case of a width of 20, each row should consume ceil(20/8) = 3 bytes. It doesn't seem like your data follows this, so you'd need to amend it.
Title: Re: Drawing a picture
Post by: lennyitb on July 24, 2014, 09:26:47 pm
Wow thanks man! This calls for emoticons!
 :angel: :w00t: *.* :hyper: :thumbsup: