0 Members and 3 Guests are viewing this topic.
ClrDraw(radians) >next time, i use (r)Pause 100 (to prevent the program fron shutting down immediately)Repeat getKeyClrDraw(r)Pt-On(Xpos,Ypos,[FFFFFFFFFFFFFFFFDispGraph(r)End
Grayscale works by changing pixels on and off repeatly. you see this as gray. You can do grayscale this way: Code: [Select]ClrDraw(radians) >next time, i use (r)Pause 100 (to prevent the program fron shutting down immediately)Repeat getKeyClrDraw(r)Pt-On(Xpos,Ypos,[FFFFFFFFFFFFFFFFDispGraph(r)EndThis displays a grayscale square somewhere on the screen (put an X and Y position in)You can do this for the whole image, but also for a part of itIf you want a part not being gray, simply don't put a (r) after the Pt-OnI hope that this short tutorial is useful for you.
How would I make the entire back buffer black?
Rect(0,64,96,64)
Ok. And one last question. How would I draw the text I want to the back buffer, and have it remain black, as the rest is gray?
Rect(0,64,96,64)rText(0,0,"This is some black text")DispGraphr
It shows the text as grayscale too.
.IMGFix 5Repeat getKey(15)Rect(0,0,96,64)^rText(0,0,"TextDispGraph^rEndFix 4
Quick Grayscale Tutorial3 level gray:Three level grayscale is utilized by using the command DispGraphr in place of the normal DispGraph command. Three level gray uses the backbuffer (L3) and the front buffer (L6). Everything on the back buffer will show as gray while everything on the front buffer will show as black. The front buffer is drawn over the back buffer, so if a pixel is "on" on both the front and back buffers, it will be shown as black.You can change the common drawing operations Pt-On, Pt-Off, Pt-Change, Pxl-On, ClrDraw, Rect, Line, DrawInv, etc. to operate on the back buffer by adding the raidan r at the end of the command. For example, Pt-On(X,Y,Pic1)r will draw Pic1 to the backbuffer. If you then look at it with DispGraph, you will see it in gray.Text, by default is drawn directly to the screen and not to the buffer. For this reason, it can appear as grayscale because it is being erased every time you call DispGraphr, and then redrawn very quickly. To make it so that text is drawn to the buffer, put a Fix 5 at the beginning of the program (and a Fix 4 at the end). To draw text to the back buffer, you will have to Exch the back and front buffers, write to the front buffer, and switch back: Code: [Select]Exch(L3,L6,768): Text(X,Y,"Text") : Exch(L3,L6,768)4 level grayWith four level gray, the front buffer becomes somewhat transparent. Use the following table to figure out the pixel colors:Code: [Select]Front:Back:Color0 :1 :Light Gray0 :0 :White1 :0 :Dark Gray1 :1 :BlackBuffer operations remain the same. To display in four level gray, use DispGraphrrNote: In order for the grayscale to show up, you must put the DispGraphr or DispGraphrr in a loop. In monochrome, you can get away with this:Code: [Select]:Pt-On(X,Y,Pic1):DispGraph:Repeat getKey:EndBut with grayscale, you'll have to write the code like this:Code: (displays Pic1 in dark gray) [Select]:Pt-On(X,Y,Pic1):Repeat getKey:DispGraph[sup]r[/sup][sup]r[/sup]:Endedit: 1000 posts
Exch(L3,L6,768): Text(X,Y,"Text") : Exch(L3,L6,768)
Front:Back:Color0 :1 :Light Gray0 :0 :White1 :0 :Dark Gray1 :1 :Black
:Pt-On(X,Y,Pic1):DispGraph:Repeat getKey:End
:Pt-On(X,Y,Pic1):Repeat getKey:DispGraph[sup]r[/sup][sup]r[/sup]:End
Quote from: ACagliano on February 17, 2011, 11:41:37 amIt shows the text as grayscale too.Code: [Select]Rect(0,64,96,64)rText(0,0,"This is some black text")DispGraphrI tried this:Code: [Select].IMGFix 5Repeat getKey(15)Rect(0,0,96,64)^rText(0,0,"TextDispGraph^rEndFix 4And I got grey background and in black, 'Text' at coordinates (0,0).What Axe version are you using? Show me your code please.
:0→{L3}:Fill(L3,767)