Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Axe Programmer on September 09, 2013, 10:53:15 am

Title: Grayscale
Post by: Axe Programmer on September 09, 2013, 10:53:15 am
In my previous posts, i have mentioned that i am making a flipbook program. I have everything straight so far, except for one problem. After a person draws a frame of the animation on the screen in black pixels, and presses enter to move onto the next new frame, i want to display the previous frame that was in black pixels in grayscale in the background. How do i do that? :banghead:

P.S. when the user presses enter, that frame is saved as a pic so it can be recalled later when playing the frames consecutivly in animation.

a detailed explanation would be helpful since i am sort of new... thanks ;D
Title: Re: Grayscale
Post by: Streetwalrus on September 09, 2013, 01:15:43 pm
DispGraph(pointer to black image, pointer to gray image)^r ;) It's got to be in a loop in order for the gray to work.
Title: Re: Grayscale
Post by: Matrefeytontias on September 10, 2013, 11:06:24 am
Using what StreetWalker said, you just have to do that :
Return!If GetCalc("Pic0")->P
DispGraph(L6, P)r
Title: Re: Grayscale
Post by: Axe Programmer on September 10, 2013, 11:11:08 am
thanks so much but i have one last question that does not have anything to  do with grayscale. In my program i am storing several pictures that is drawn by the user. so could i make a subroutine that every time it is visited it will store a new pic into ram. it is hard to describe what i am saying but maybe a code will help:

(there are other things in this loop, but i just put the neccesary ones)

Reapeat getkey(15)
If getkey(9)
sub(A)
End
End


Lbl A
Now what codes would i put here so that when this loop is visited it will store the graphscreen into a pic which is saved in the ram? I want this subroutine to be visitd multiple times throughout the program and store the current graph screen into a new pic everytime.
if i am not able to do this, will i have to make several subroutines that can only store one individual pic?

Please ask if you dont understand what i am trying to say.. thanks
Title: Re: Grayscale
Post by: Matrefeytontias on September 10, 2013, 12:06:45 pm
You can use hacked pics to do that. The theory is that when you do GetCalc("Pic1"), "Pic1" is converted by Axe to [AA0100] IIRC. So instead of "Pic1" you can write GetCalc([AA0100]). To use a different pic, just change the 2nd byte (01) into something else.

Using this theory, you can for example put [AA0000] in a GDB, so each time  you call your subroutine, GetCalc this GDB, store your pic to it and increment the 2nd byte starting at this GDB (thus, GDB+1).