Revision history for KeyPgPcopy


Revision [22041]

Last edited on 2017-12-13 02:48:55 by fxm [Added the "Return value" paragraph]
Additions:
The error code returned by ##**Pcopy**## can be checked using ##[[KeyPgErr|Err]]## in the next line. The function version of ##**Pcopy**## returns directly the error code as a 32 bit ##[[KeyPgLong|Long]]##.


Revision [22038]

Edited on 2017-12-13 02:33:54 by fxm [Added the "Return value" paragraph]
Additions:
{{fbdoc item="ret"}}
Returns zero (##0##) if successful, or a non-zero error code to indicate a failure.


Revision [21077]

Edited on 2016-03-13 09:06:25 by fxm [Formatting]

No Differences

Revision [20439]

Edited on 2016-02-10 16:06:26 by DkLwikki [Update link format]
Additions:
[[KeyPgDeclare|declare]] [[KeyPgFunction|function]] **Pcopy** ( [[KeyPgByval|byval]] //source// [[KeyPgAs|as]] [[KeyPgLong|long]] = -1, [[KeyPgByval|byval]] //destination// [[KeyPgAs|as]] [[KeyPgLong|long]] = -1 ) [[KeyPgAs|as]] [[KeyPgLong|long]]
- Maximum number of graphics pages depends on what was specified when the ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|Screenres]]## statement was called.
- ##[[KeyPgScreencopy|Screencopy]]##
- ##[[KeyPgFlip|Flip]]##
- ##[[KeyPgScreengraphics|Screen]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Pcopy** ( [[KeyPgByval byval]] //source// [[KeyPgAs as]] [[KeyPgLong long]] = -1, [[KeyPgByval byval]] //destination// [[KeyPgAs as]] [[KeyPgLong long]] = -1 ) [[KeyPgAs as]] [[KeyPgLong long]]
- Maximum number of graphics pages depends on what was specified when the ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres Screenres]]## statement was called.
- ##[[KeyPgScreencopy Screencopy]]##
- ##[[KeyPgFlip Flip]]##
- ##[[KeyPgScreengraphics Screen]]##


Revision [17528]

Edited on 2015-04-01 12:28:42 by DkLwikki [integer => long]
Additions:
[[KeyPgDeclare declare]] [[KeyPgFunction function]] **Pcopy** ( [[KeyPgByval byval]] //source// [[KeyPgAs as]] [[KeyPgLong long]] = -1, [[KeyPgByval byval]] //destination// [[KeyPgAs as]] [[KeyPgLong long]] = -1 ) [[KeyPgAs as]] [[KeyPgLong long]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgSub sub]] **Pcopy** ( [[KeyPgByval byval]] //source// [[KeyPgAs as]] [[KeyPgInteger integer]] = -1, [[KeyPgByval byval]] //destination// [[KeyPgAs as]] [[KeyPgInteger integer]] = -1 )


Revision [17322]

Edited on 2014-10-08 17:02:32 by FxMwikki [Pcopy is inactive if the destination page is locked]
Additions:
##**Pcopy**## is inactive if the ##//destination//## page is locked.
Deletions:
The copy is inactive if the ##//destination//## page is locked.


Revision [17320]

Edited on 2014-10-08 16:44:53 by FxMwikki [The copy is inactive if the destination page is locked.]
Additions:
The copy is inactive if the ##//destination//## page is locked.


Revision [16733]

Edited on 2013-04-29 00:10:48 by CountingPine [Make graphics example clearer]
Additions:
'Sets up the screen to be 320x200 in 8-bit color with 2 video pages.
ScreenRes 320, 200, 8, 2
'Sets the working page to 1 and the displayed page to 0
ScreenSet 1, 0
'Draws a circle moving across the top of the screen
for x as integer = 50 to 269
Cls 'Clears the screen so we can start fresh
Circle (x, 50), 50, 14 'Draws a yellow circle with a 50 pixel radius on page 1
PCopy 1, 0 'Copies our image from page 1 to page 0
Sleep 25 'Waits for 25 milliseconds.
next x
'Wait for a keypress before the screen closes
Sleep
Deletions:
screenres 320, 240, 32, 2 'Sets up the screen to be 320x240 in 32-bit color with 2 video pages.
dim as integer max_x_value = 270, x_value = 50 'Dimension our working variables.
do while x_value < max_x_value 'Loop while x_value is less than the max
screenset 1,0 'Sets the working page to 1 and the displayed page to 0
cls 'Clears the screen so we can start fresh
circle (x_value,50),50,&h00FFFF00 'Draws a circle with a 50 pixel radius in yellow on page 1
pcopy 1,0 'Copies our circle from page 1 to page 0
x_value += 1 'Increments x_value so it will move.
sleep 25 'Waits for 25 milliseconds.
loop 'Goes back to do as long as x_value is less than x_max_value
sleep 'Waits for any key to be pressed so you can see the work done.


Revision [15335]

Edited on 2011-10-02 11:14:35 by FxMwikki [In first example, the two video pages must be #0 and #1, and ScreenSync is useless]
Deletions:
screensync 'Waits for vertical refresh


Revision [15331]

Edited on 2011-10-02 10:29:55 by FxMwikki [In first example, correction of video pages numbers (the two video pages must be #0 and #1)]
Additions:
screenset 1,0 'Sets the working page to 1 and the displayed page to 0
circle (x_value,50),50,&h00FFFF00 'Draws a circle with a 50 pixel radius in yellow on page 1
pcopy 1,0 'Copies our circle from page 1 to page 0
Deletions:
screenset 2,1 'Sets the working page to 2 and the displayed page to 1
circle (x_value,50),50,&h00FFFF00 'Draws a circle with a 50 pixel radius in yellow on page 2
screenset 1,1 'Sets the working page to 1 and the displayed page to 1
pcopy 2,1 'Copies our circle from page 2 to page 1


Revision [15306]

Edited on 2011-10-01 07:58:41 by DkLwikki [Fix double "Examples:" header]
Additions:
{{fbdoc item="filename" value="examples/manual/gfx/pcopy.bas"}}%%(freebasic)

{{fbdoc item="filename" value="examples/manual/gfx/pcopy_cons.bas"}}%%(freebasic)
'' Console mode example:
'' Set the working page number to 0, and the visible page number to 1
Screen ,, 0, 1
Screen , 0, 1
Dim As Integer i, frames, fps
Dim As Double t
t = Timer
Do
'' Fill working page with a certain color and character
Cls
Locate 1, 1
Color (i And 15), 0
Print String$(80 * 25, Hex$(i, 1));
'' Show frames per second
Color 15, 0
Locate 1, 1
Print "fps: " & fps,
If Int(t) <> Int(Timer) Then
t = Timer
End If
'' Copy working page to visible page
PCopy
'' Sleep 50ms per frame to free up cpu time
Sleep 50, 1
'' Run loop until the user presses a key
Loop Until Len(Inkey$)
Deletions:
{{fbdoc item="filename" value="examples/manual/gfx/pcopy.bas"}}%%(freebasic)
{{fbdoc item="filename" value="examples/manual/gfx/pcopy_cons.bas"}}%%(freebasic)
' Console mode example:
'' set the working page number to 0, and the visible page number to 1
screen ,, 0, 1
screen , 0, 1
dim as integer i, frames, fps
dim as double t
t = timer
do
'' fill working page with a certain color and character
cls
locate 1, 1
color (i and 15), 0
print string$(80 * 25, hex$(i, 1));
'' show frames per second
color 15, 0
locate 1, 1
print "fps: " & fps,
if int(t) <> int(timer) then
t = timer
end if
'' copy working page to visible page
pcopy
'' sleep 50ms per frame to free up cpu time
sleep 50, 1
'' run loop until user presses a key
loop until len(inkey$)


Revision [14141]

Edited on 2009-05-19 01:48:40 by CountingPine [Fix example again; add link to SCREEN]
Additions:
#if __FB_LANG__ = "QB"
screen ,, 0, 1
#else
#endif
t = timer
fps = frames
frames = 0
- ##[[KeyPgScreengraphics Screen]]##
Deletions:
t = timer
fps = frames
frames = 0


Revision [14139]

Edited on 2009-05-19 01:31:20 by CountingPine [Make example runnable in lang qb]
Additions:
' Console mode example:
dim as integer i, frames, fps
dim as double t
t = timer
color (i and 15), 0
print string$(80 * 25, hex$(i, 1));
t = timer
fps = frames
frames = 0
sleep 50, 1
loop until len(inkey$)
Deletions:
'' Console mode example:
dim as integer i = 0
dim as integer frames = 0, fps = 0
dim as double t = timer
color i and 15, 0
print string(80 * 25, hex(i, 1));
t = timer
fps = frames
frames = 0
sleep 50
loop until len(inkey)


Revision [14121]

Edited on 2009-02-28 02:26:44 by CountingPine [Add console example]
Additions:
{{fbdoc item="filename" value="examples/manual/gfx/pcopy_cons.bas"}}%%(freebasic)
'' Console mode example:
'' set the working page number to 0, and the visible page number to 1
screen , 0, 1
dim as integer i = 0
dim as integer frames = 0, fps = 0
dim as double t = timer
do
'' fill working page with a certain color and character
cls
locate 1, 1
color i and 15, 0
print string(80 * 25, hex(i, 1));
i += 1
'' show frames per second
color 15, 0
locate 1, 1
print "fps: " & fps,
if int(t) <> int(timer) then
t = timer
fps = frames
frames = 0
end if
frames += 1
'' copy working page to visible page
pcopy
'' sleep 50ms per frame to free up cpu time
sleep 50
'' run loop until user presses a key
loop until len(inkey)


Revision [11381]

The oldest known version of this page was created on 2007-10-18 09:29:09 by JeffMarshall [Add console example]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode