Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Axe Programmer on September 06, 2013, 11:19:11 am

Title: Pic Variable
Post by: Axe Programmer on September 06, 2013, 11:19:11 am
I want to make a flipbook program that is fast and easy to use. i want to be able to store the pixels drawn on the graph screen (when the user presses enter) into an external variable that can later recall that saved picture. how do i save what is on the graph screen as a variable or something?
Title: Re: Pic Variable
Post by: Runer112 on September 06, 2013, 11:23:22 am
The graph screen is L6, so it should be as simple as something like this:

Code: [Select]
.Use 768 if images are created outside of the OS and may contain data in the last row

!If GetCalc("Pic0",756)→P
 .Not enough RAM
End
Copy(L₆,P,756)
Title: Re: Pic Variable
Post by: Matrefeytontias on September 06, 2013, 11:24:24 am
Actually the graph screen is L6, aka plotSScreen. All you have to do to save it in a var is to create for example a 768-bytes appvar (plotSScreen is 768 bytes large) and copy L6 to it. The proper way to do this would be :

:GetCalc("appvSAVEDIMG",768)→A
:Return!If A      // quits if the appvar couldn't be created
:Copy(L6,A)       // optimized version, copies 768 bytes from A to L6


EDIT : ninja'd :ninja:
Title: Re: Pic Variable
Post by: Axe Programmer on September 06, 2013, 11:26:31 am
how do i recall pic 0 on the screen?
sorry i am kind of new at this..
Title: Re: Pic Variable
Post by: Matrefeytontias on September 06, 2013, 11:29:09 am
The graph screen is L6, so it should be as simple as something like this:

Code: [Select]
!If GetCalc("Pic0",768)→P
 .Not enough RAM
End
Copy(L₆,P,768)
Actually that's kinda wrong, since TI-OS pics are 756 bytes.

how do i recall pic 0 on the screen?
sorry i am kind of new at this..
All you have to do is to access TI-OS's Pic0 with GetCalc and copy it back to L6 (remember it's 756 bytes this time) :

GetCalc("Pic0")→A
Copy(A,L6,756)
DispGraph
Title: Re: Re: Re: Pic Variable
Post by: DJ Omnimaga on September 06, 2013, 12:03:33 pm
The graph screen is L6, so it should be as simple as something like this:

Code: [Select]
!If GetCalc("Pic0",768)→P
 .Not enough RAM
End
Copy(L₆,P,768)
Actually that's kinda wrong, since TI-OS pics are 756 bytes.

how do i recall pic 0 on the screen?
sorry i am kind of new at this..
All you have to do is to access TI-OS's Pic0 with GetCalc and copy it back to L6 (remember it's 756 bytes this time) :

GetCalc("Pic0")→A
Copy(A,L6,756)
DispGraph

it's possible to create 768 bytes pics too actually (779 total with the var name and stuff). You need to store it with the xLIB storepic command then the 96x64 pic can be recalled fine using TI-OS recallpic functions.
Title: Re: Pic Variable
Post by: shmibs on September 06, 2013, 05:37:43 pm
using OS functions to recall still chops off the bottom row of pixels, though, doesn't it?
Title: Re: Pic Variable
Post by: DJ Omnimaga on September 06, 2013, 10:52:26 pm
I think I recall displaying such pic fine before. The only real issues I had was with early versions of xLIB, where the last row usually turned into garbage.
Title: Re: Pic Variable
Post by: Streetwalrus on September 07, 2013, 07:16:27 am
using OS functions to recall still chops off the bottom row of pixels, though, doesn't it?
You're correct. ;)
Title: Re: Pic Variable
Post by: Axe Programmer on September 09, 2013, 11:14:26 am
thanks for the help guys