Author Topic: Pic Variable  (Read 1866 times)

0 Members and 1 Guest are viewing this topic.

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Pic Variable
« 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?

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Pic Variable
« Reply #1 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)
« Last Edit: September 06, 2013, 11:35:21 am by Runer112 »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Pic Variable
« Reply #2 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:
« Last Edit: September 06, 2013, 11:24:56 am by Matrefeytontias »

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Pic Variable
« Reply #3 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..

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Pic Variable
« Reply #4 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
« Last Edit: September 06, 2013, 11:33:55 am by Matrefeytontias »

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55845
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Re: Re: Pic Variable
« Reply #5 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.
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Pic Variable
« Reply #6 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?

Offline DJ Omnimaga

  • Former TI programmer
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55845
  • Rating: +3151/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Pic Variable
« Reply #7 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.
In case you are wondering where I went, I left Omni back in 2015 to form CodeWalrus due to various reasons explained back then, but I stopped calc dev in 2016 and am now mostly active on the CW Discord server at https://discord.gg/cuZcfcF



Official Website |T-Shirt store | Reverbnation | Facebook | Youtube | Twitter | Spotify

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Pic Variable
« Reply #8 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. ;)

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Pic Variable
« Reply #9 on: September 09, 2013, 11:14:26 am »
thanks for the help guys
« Last Edit: September 09, 2013, 11:14:36 am by Axe Programmer »