Revision history for KeyPgGetgraphics


Revision [21726]

Last edited on 2016-12-04 09:09:16 by fxm [Refined sentences]
Additions:
##//dest//## can be an address, an [[ProPgArrays|array]] (name not followed by empty parentheses), or a reference to the first element in an [[ProPgArrays|array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer (the number of bytes required varies with the [[CompilerOptlang|-lang dialect]] used to compile the program). Valid image buffers can be created simply by using preferably the ##[[KeyPgImagecreate|ImageCreate]]## statement.
##//source//## can be an address, an [[ProPgArrays|array]] (name not followed by empty parentheses), or a reference to the first element in an [[ProPgArrays|array]] that holds an image buffer to retrieve a portion of. ##//x1//##, ##//y1//##, ##//x2//##, ##//y2//##, ##**Step**## and ##//dest//## have the same meaning in this case.
Deletions:
##//dest//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer (the number of bytes required varies with the [[CompilerOptlang|-lang dialect]] used to compile the program). Valid image buffers can be created simply by using preferably the ##[[KeyPgImagecreate|ImageCreate]]## statement.
##//source//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that holds an image buffer to retrieve a portion of. ##//x1//##, ##//y1//##, ##//x2//##, ##//y2//##, ##**Step**## and ##//dest//## have the same meaning in this case.


Revision [21636]

Edited on 2016-10-30 18:11:12 by fxm [Formatting]
Additions:


Revision [20735]

Edited on 2016-03-12 06:53:14 by fxm [Added sentence and link about ImageCreate]
Additions:

##//dest//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer (the number of bytes required varies with the [[CompilerOptlang|-lang dialect]] used to compile the program). Valid image buffers can be created simply by using preferably the ##[[KeyPgImagecreate|ImageCreate]]## statement.





- ##[[KeyPgImagecreate|ImageCreate]]##
Deletions:
##//dest//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer; the number of bytes required varies with the [[CompilerOptlang|-lang dialect]] used to compile the program.


Revision [20253]

Edited on 2016-02-10 16:00:52 by DkLwikki [Update link format]
Additions:
##**Get**## copies a rectangular portion of the current work page specified by the co-ordinates (##//x1//##, ##//y1//##) and (##//x2//##, ##//y2//##), which represent the upper-left and lower-right corners of the rectangle, respectively. ##STEP## specifies that the upper-left co-ordinates are relative to the current graphics pen location, and/or that the lower-right co-ordinates are relative to the upper-left co-ordinates. The new image buffer is formatted to match the current screen mode [[GfxInternalFormats|pixel format]].
##//dest//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer; the number of bytes required varies with the [[CompilerOptlang|-lang dialect]] used to compile the program.
##//source//## can be an address, an [[ProPgArrays|array]], or a reference to the first element in an [[ProPgArrays|array]] that holds an image buffer to retrieve a portion of. ##//x1//##, ##//y1//##, ##//x2//##, ##//y2//##, ##**Step**## and ##//dest//## have the same meaning in this case.
The co-ordinates of the rectangle are affected by the most recent ##[[KeyPgWindow|Window]]## and ##[[KeyPgViewgraphics|View (Graphics)]]## statements, and must both be within the current clipping region set by ##[[KeyPgViewgraphics|View (Graphics)]]##, otherwise an illegal function call runtime error will be triggered, and the function will have no effect.
##**Get**## throws one of the following [[ProPgErrorHandling|runtime errors]]:
- The upper-left or lower-right co-ordinates of the rectangle are outside the current clipping region. See ##[[KeyPgViewgraphics|View (Graphics)]]##.
- In the //[[CompilerOptlang|-lang fb]]// dialect, ##//dest//## receives a new-style image buffer, which consists of a 32-byte image header followed by pixel data which is row-padded to the next paragraph boundary (16 bytes). Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- In the //[[CompilerOptlang|-lang qb]]// and //[[CompilerOptlang|-lang fblite]]// dialects, ##//dest//## receives a QB-style image buffer, which consists of a 4-byte image header followed by pixel data which is not row-padded. Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- ##[[KeyPgPutgraphics|Put (Graphics)]]##
- ##[[KeyPgGetfileio|Get (File I/O)]]##
- ##[[KeyPgScreengraphics|Screen (Graphics)]]##
- ##[[KeyPgWindow|Window]]##
- ##[[KeyPgViewgraphics|View (Graphics)]]##
- [[GfxInternalFormats|Internal graphics formats]]
Deletions:
##**Get**## copies a rectangular portion of the current work page specified by the co-ordinates (##//x1//##, ##//y1//##) and (##//x2//##, ##//y2//##), which represent the upper-left and lower-right corners of the rectangle, respectively. ##STEP## specifies that the upper-left co-ordinates are relative to the current graphics pen location, and/or that the lower-right co-ordinates are relative to the upper-left co-ordinates. The new image buffer is formatted to match the current screen mode [[GfxInternalFormats pixel format]].
##//dest//## can be an address, an [[ProPgArrays array]], or a reference to the first element in an [[ProPgArrays array]] that will receive the new image buffer. This memory must be sufficiently allocated to hold the image buffer; the number of bytes required varies with the [[CompilerOptlang -lang dialect]] used to compile the program.
##//source//## can be an address, an [[ProPgArrays array]], or a reference to the first element in an [[ProPgArrays array]] that holds an image buffer to retrieve a portion of. ##//x1//##, ##//y1//##, ##//x2//##, ##//y2//##, ##**Step**## and ##//dest//## have the same meaning in this case.
The co-ordinates of the rectangle are affected by the most recent ##[[KeyPgWindow Window]]## and ##[[KeyPgViewgraphics View (Graphics)]]## statements, and must both be within the current clipping region set by ##[[KeyPgViewgraphics View (Graphics)]]##, otherwise an illegal function call runtime error will be triggered, and the function will have no effect.
##**Get**## throws one of the following [[ProPgErrorHandling runtime errors]]:
- The upper-left or lower-right co-ordinates of the rectangle are outside the current clipping region. See ##[[KeyPgViewgraphics View (Graphics)]]##.
- In the //[[CompilerOptlang -lang fb]]// dialect, ##//dest//## receives a new-style image buffer, which consists of a 32-byte image header followed by pixel data which is row-padded to the next paragraph boundary (16 bytes). Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, ##//dest//## receives a QB-style image buffer, which consists of a 4-byte image header followed by pixel data which is not row-padded. Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- ##[[KeyPgPutgraphics Put (Graphics)]]##
- ##[[KeyPgGetfileio Get (File I/O)]]##
- ##[[KeyPgScreengraphics Screen (Graphics)]]##
- ##[[KeyPgWindow Window]]##
- ##[[KeyPgViewgraphics View (Graphics)]]##
- [[GfxInternalFormats Internal graphics formats]]


Revision [17606]

Edited on 2015-04-20 16:10:50 by FxMwikki [Corrected inconsistency in example]
Additions:
draw string (30, 20), "Hello there!", rgb(255,0,0)
get (0,0)-(150-1,50-1), image
put (0,50), image
put (0,100), image
put (0,150), image
put (0,200), image
put (0,250), image
put (150,0), image
line (0,0)-(400-1,300-1), rgb(255,255,0), b
get (0,0)-(400-1,300-1), big
put (x,0), big
Deletions:
draw string (20, 20), "Hello there!", rgb(255,0,0)
get (1,1)-(150,50), image
put (1,50), image
put (1,100), image
put (1,150), image
put (1,200), image
put (1,250), image
put (150,1), image
line (1,1)-(400-1,300-1), rgb(255,255,0), b
get (1,1)-(400-1,300-1), big
put (x,1), big


Revision [15589]

Edited on 2011-12-29 12:05:59 by CountingPine [Make syntax/params more like on PUT page]
Additions:
**Get** [//source//,] [STEP](//x1//, //y1//) - [STEP](//x2//, //y2//), //dest//
##STEP##
##[STEP](//x1//, //y1//)##
co-ordinates of the upper-left corner of the sub-image to copy. ##STEP## indicates that ##(//x1//, //y1//)## offsets are relative to the current graphics cursor position.
##[STEP](//x2//, //y2//)##
co-ordinates of the lower-right corner of the sub-image to copy. ##STEP## indicates that ##//x2//## and ##//y2//## are relative to ##//x1//## and ##//y1//##, respectively.
##**Get**## copies a rectangular portion of the current work page specified by the co-ordinates (##//x1//##, ##//y1//##) and (##//x2//##, ##//y2//##), which represent the upper-left and lower-right corners of the rectangle, respectively. ##STEP## specifies that the upper-left co-ordinates are relative to the current graphics pen location, and/or that the lower-right co-ordinates are relative to the upper-left co-ordinates. The new image buffer is formatted to match the current screen mode [[GfxInternalFormats pixel format]].
Deletions:
**Get** [//source//,] [Step] (//x1//, //y1//) - [STEP] (//x2//, //y2//), //dest//
##Step##
##//x1//##, ##//y1//##
co-ordinates of the upper-left corner of the sub-image to copy.
##//x2//##, ##//y2//##
co-ordinates of the lower-right corner of the sub-image to copy.
##**Get**## copies a rectangular portion of the current work page specified by the co-ordinates (##//x1//##, ##//y1//##) and (##//x2//##, ##//y2//##), which represent the upper-left and lower-right corners of the rectangle, respectively. ##**Step**## specifies that the upper-left co-ordinates are relative to the current graphics pen location, and/or that the lower-right co-ordinates are relative to the upper-left co-ordinates. The new image buffer is formatted to match the current screen mode [[GfxInternalFormats pixel format]].


Revision [15583]

Edited on 2011-12-28 13:57:56 by DkLwikki [Remove stray ']']
Additions:
**Get** [//source//,] [Step] (//x1//, //y1//) - [STEP] (//x2//, //y2//), //dest//
Deletions:
**Get** [//source//,] [Step] (//x1//, //y1//) - [STEP] (//x2//, //y2//), //dest//]


Revision [15089]

Edited on 2011-05-19 14:55:19 by DkLwikki [Added GET example]
Additions:
{{fbdoc item="filename" value="examples/manual/gfx/get.bas"}}%%(freebasic)
#include once "fbgfx.bi"
'' Setup a 400x300 32bit screen
screenres 400, 300, 32
'' First draw funny stuff...
line (10,10)-(140,30), rgb(255,255,0), bf
draw string (20, 20), "Hello there!", rgb(255,0,0)
'' Now capture a 150x50 block from the top-left of the screen into an image
'' buffer with GET...
dim as fb.Image ptr image = imagecreate(150, 50)
get (1,1)-(150,50), image
'' And duplicate it all over the place!
put (1,50), image
put (1,100), image
put (1,150), image
put (1,200), image
put (1,250), image
put (150,1), image
put (150,50), image
put (150,100), image
put (150,150), image
put (150,200), image
put (150,250), image
'' And a frame around a whole screen..
line (1,1)-(400-1,300-1), rgb(255,255,0), b
'' Now get the whole screen...
dim as fb.Image ptr big = imagecreate(400, 300)
get (1,1)-(400-1,300-1), big
'' And display that "screenshot" as if it was scrolling by...
dim as integer x = -350
while ((inkey() = "") and (x < 350))
screenlock
cls
put (x,1), big
screenunlock
sleep 100, 1
x += 10
wend
%%
Deletions:
For an example see ##[[KeyPgPutgraphics Put (Graphics)]]##.


Revision [13784]

Edited on 2008-10-12 06:32:24 by DoS386 [clean-up duplicate, please recheck]
Additions:
There are 2 types of buffers (details see [[GfxInternalFormats]]) depending from FB dialect used:
- In the //[[CompilerOptlang -lang fb]]// dialect, ##//dest//## receives a new-style image buffer, which consists of a 32-byte image header followed by pixel data which is row-padded to the next paragraph boundary (16 bytes). Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, ##//dest//## receives a QB-style image buffer, which consists of a 4-byte image header followed by pixel data which is not row-padded. Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode:
- [[GfxInternalFormats Internal graphics formats]]
Deletions:
- In the //[[CompilerOptlang -lang fb]]// dialect, ##//dest//## receives a new-style image buffer, which consists of a 32-byte image header followed by pixel data which is row-padded to the next paragraph boundary (16 bytes). Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode [[GfxInternalFormats pixel format]]:
- In the //[[CompilerOptlang -lang qb]]// and //[[CompilerOptlang -lang fblite]]// dialects, ##//dest//## receives a QB-style image buffer, which consists of a 4-byte image header followed by pixel data which is not row-padded. Use the following formula to calculate the total size, in bytes, required to store the image buffer, where ##w## and ##h## are the respective width and height of the rectangular portion of the current work page or source image buffer, and ##bpp## is the number of bytes per pixel of the current screen mode [[GfxInternalFormats pixel format]]:
- [[GfxInternalFormats Internal pixel formats]]


Revision [12914]

The oldest known version of this page was created on 2008-04-13 08:35:37 by JeffMarshall [clean-up duplicate, please recheck]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode