Author Topic: Grayscale  (Read 2529 times)

0 Members and 1 Guest are viewing this topic.

Offline Axe Programmer

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

Offline Streetwalrus

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

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Grayscale
« Reply #2 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

Offline Axe Programmer

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +0/-0
    • View Profile
Re: Grayscale
« Reply #3 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
« Last Edit: September 10, 2013, 11:23:57 am by Axe Programmer »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Grayscale
« Reply #4 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).
« Last Edit: September 10, 2013, 12:07:45 pm by Matrefeytontias »