Revision history for KeyPgViewgraphics


Revision [21649]

Last edited on 2016-10-30 19:12:28 by fxm [Formatting]
Additions:
- The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters.
Deletions:
- The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters.@@


Revision [21523]

Edited on 2016-08-10 02:42:18 by fxm [Rewording / Formatting]
Additions:
The first statement (##**View**##) sets the viewport to encompass the entire screen, which is the default viewport for a new graphics screen.
The second and third statements (##**View**## ##//parameters//## and ##**View** Screen## ##//parameters//##) both allow a new viewport to be defined. The indicated effects for each parameter only occur if that parameter is specified:
- The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters.@@
- ##//fill_color//## and ##//border_color//## are both in the format accepted by ##[[KeyPgColor|Color]]##.
- The second statement (##**View**## ##//parameters//##) modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the viewport.
- The third statement (##**View** Screen## ##//parameters//##) modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the screen.
- In both cases no new scale factor is applied (see ##[[KeyPgWindow|Window]]## for that).
Deletions:
The first statement sets the viewport to encompass the entire screen, which is the default viewport for a new graphics screen.
The second and third statements both allow a new viewport to be defined. The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters. ##//fill_color//## and ##//border_color//## are both in the format accepted by ##[[KeyPgColor|Color]]##. The indicated effects for each parameter only occur if that parameter is specified.
The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the screen.


Revision [21519]

Edited on 2016-08-08 14:30:01 by fxm [Added "graphics" several times in the description]
Additions:
Sets new physical coordinate mapping and clipping region for graphics keywords
The //viewport//, or clipping region, is a rectangular area of the graphics screen, outside of which no graphics drawing will be done. That is, only graphics drawing done within this area will be shown. A graphics screen must be created with ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]## before calling ##**View**## or ##**View Screen**##.
The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the coordinate mapping of the graphics screen such that coordinates specified for graphics drawing statements and procedures are relative to the top-left corner of the screen.
Deletions:
Sets new physical coordinate mapping and clipping region
The //viewport//, or clipping region, is a rectangular area of the graphics screen, outside of which no drawing will be done. That is, only drawing done within this area will be shown. A graphics screen must be created with ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]## before calling ##**View**## or ##**View Screen**##.
The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the screen.


Revision [21177]

Edited on 2016-03-13 11:42:18 by fxm [Formatting]

No Differences

Revision [20586]

Edited on 2016-02-10 16:10:30 by DkLwikki [Update link format]
Additions:
##//x1//## ##[[KeyPgAs|as]] [[KeyPgInteger|Integer]]##, ##//y1//## ##[[KeyPgAs|as]] [[KeyPgInteger|Integer]]##
##//x2//## ##[[KeyPgAs|as]] [[KeyPgInteger|Integer]]##, ##//y2//## ##[[KeyPgAs|as]] [[KeyPgInteger|Integer]]##
##//fill_color//## ##[[KeyPgAs|as]] [[KeyPgUinteger|UInteger]]##
##//border_color//## ##[[KeyPgAs|as]] [[KeyPgUinteger|UInteger]]##
The //viewport//, or clipping region, is a rectangular area of the graphics screen, outside of which no drawing will be done. That is, only drawing done within this area will be shown. A graphics screen must be created with ##[[KeyPgScreengraphics|Screen]]## or ##[[KeyPgScreenres|ScreenRes]]## before calling ##**View**## or ##**View Screen**##.
The second and third statements both allow a new viewport to be defined. The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters. ##//fill_color//## and ##//border_color//## are both in the format accepted by ##[[KeyPgColor|Color]]##. The indicated effects for each parameter only occur if that parameter is specified.
- ##[[KeyPgViewtext|View Print]]##
- ##[[KeyPgScreengraphics|Screen (Graphics)]]##
- ##[[KeyPgWindow|Window]]##
- ##[[KeyPgPmap|Pmap]]##
Deletions:
##//x1//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##, ##//y1//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##
##//x2//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##, ##//y2//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##
##//fill_color//## ##[[KeyPgAs as]] [[KeyPgUinteger UInteger]]##
##//border_color//## ##[[KeyPgAs as]] [[KeyPgUinteger UInteger]]##
The //viewport//, or clipping region, is a rectangular area of the graphics screen, outside of which no drawing will be done. That is, only drawing done within this area will be shown. A graphics screen must be created with ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres ScreenRes]]## before calling ##**View**## or ##**View Screen**##.
The second and third statements both allow a new viewport to be defined. The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters. ##//fill_color//## and ##//border_color//## are both in the format accepted by ##[[KeyPgColor Color]]##. The indicated effects for each parameter only occur if that parameter is specified.
- ##[[KeyPgViewtext View Print]]##
- ##[[KeyPgScreengraphics Screen (Graphics)]]##
- ##[[KeyPgWindow Window]]##
- ##[[KeyPgPmap Pmap]]##


Revision [16877]

Edited on 2013-06-25 23:10:38 by CountingPine [Minor changes, clean up example a little]
Additions:
The second statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the coordinate mapping of the graphics screen such that coordinates specified for drawing statements and procedures are relative to the top-left corner of the screen.
dim ip as any ptr
dim as integer x, y
ip = imagecreate(64,64)
for y = 0 to 63
for x = 0 to 63
pset ip, (x, y), (x\4) Xor (y\4)
next x
next y
'viewport with blue border
line (215,135)-(425,345), 1, bf
view (220,140)-(420,340)
'move sprite around the viewport
x = 100*sin(timer*2.0)+50
y = 100*sin(timer*2.7)+50


'clear viewport and put image
cls 1
put (x, y), ip, pset

loop while inkey = ""
Deletions:
The second statement modifies the co-ordinate mapping of the graphics screen such that co-ordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the co-ordinate mapping of the graphics screen such that co-ordinates specified for drawing statements and procedures are relative to the top-left corner of the screen.
dim ip as integer ptr
dim as integer i, j, k
for i=0 to 63: for j=0 to 63:pset (i,j), (i\4) xor (j\4):next j,i
ip=imagecreate(64,64)
get (0,0)-(63,63),ip
cls
'viewport
line (215,135)-(425,345),1,bf
view (220,140)-(420,340)
k=0
'move sprite
i=100*sin(k*.02)+50: j=100* sin(k*.027)+50
cls 1: put (i,j),ip ,pset
k=k+1
loop until len(inkey)


Revision [14194]

Edited on 2009-07-06 22:03:51 by LaananFisher [fixed: coords specify opposite, but not specific, corners]
Additions:
The horizontal and vertical offsets, in pixels, of one corner of the viewport relative to the top-left corner of the screen.
The horizontal and vertical offsets, in pixels, of the opposite corner of the viewport relative to the top-left corner of the screen.
Deletions:
The horizontal and vertical offsets, in pixels, of the top-left corner of the viewport relative to the top-left corner of the screen.
The horizontal and vertical offsets, in pixels, of the bottom-right corner of the viewport relative to the top-left corner of the screen.


Revision [14193]

Edited on 2009-07-06 20:27:06 by LaananFisher [updated: formatting; todo: image buffers in description]
Additions:
**View**
**View** ( //x1//, //y1// )-( //x2//, //y2// ) [ [, //fill_color// ] [, //border_color// ] ]
**View Screen** ( //x1//, //y1// )-( //x2//, //y2// ) [ [, //fill_color// ] [, //border_color// ] ]
##//x1//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##, ##//y1//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##
The horizontal and vertical offsets, in pixels, of the top-left corner of the viewport relative to the top-left corner of the screen.
##//x2//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##, ##//y2//## ##[[KeyPgAs as]] [[KeyPgInteger Integer]]##
The horizontal and vertical offsets, in pixels, of the bottom-right corner of the viewport relative to the top-left corner of the screen.
##//fill_color//## ##[[KeyPgAs as]] [[KeyPgUinteger UInteger]]##
The color to fill the new viewport.
##//border_color//## ##[[KeyPgAs as]] [[KeyPgUinteger UInteger]]##
The color of the border to draw around the new viewport.
The //viewport//, or clipping region, is a rectangular area of the graphics screen, outside of which no drawing will be done. That is, only drawing done within this area will be shown. A graphics screen must be created with ##[[KeyPgScreengraphics Screen]]## or ##[[KeyPgScreenres ScreenRes]]## before calling ##**View**## or ##**View Screen**##.
The first statement sets the viewport to encompass the entire screen, which is the default viewport for a new graphics screen.
The second and third statements both allow a new viewport to be defined. The corners of the viewport are specified by the ##//x1//##, ##//y1//##, ##//x2//## and ##//y2//## parameters. ##//fill_color//## and ##//border_color//## are both in the format accepted by ##[[KeyPgColor Color]]##. The indicated effects for each parameter only occur if that parameter is specified.
The second statement modifies the co-ordinate mapping of the graphics screen such that co-ordinates specified for drawing statements and procedures are relative to the top-left corner of the viewport.
The third statement modifies the co-ordinate mapping of the graphics screen such that co-ordinates specified for drawing statements and procedures are relative to the top-left corner of the screen.
- ""FreeBASIC's"" current behavior is to preserve the ##WINDOW## coordinates after calls to ##VIEW##, or when working on images, meaning that the coordinate mapping may undergo scaling/translations if the viewport changes. (If a ##WINDOW## hasn't been set, there is no coordinate mapping, and so it doesn't change after calls to ##VIEW##.) The behavior may change in future, but consistent behavior can be assured over inconstent viewport coordinates by re-calling ##WINDOW## whenever you change the ##VIEW##.
Deletions:
**View** [SCREEN] ( //x1//, //y1// )-( //x2//, //y2// )[, [ //color// ] [, //border// ]]]
##SCREEN##
When specified, any x,y coordinate will be relative to the top-left corner of the screen, and not to the left-top corner of the viewport.
##( //x1//, //y1// )-( //x2//, //y2// )##
Coordinates of the top-left and bottom-right corners of the new viewport in screen pixels.
##//color//##
Color with which to clear the new viewport; if omitted, the viewport will not be cleared.
##//border//##
Color of the border box surrounding the new viewport. If omitted, no border box will be drawn.
Use this statement to set a new clipping region, also known as viewport. The new viewport will override the previous one, if any; if the ##SCREEN## argument is omitted, all future coordinates specifications will be relative to the top-left corner of the new viewport, instead of relative to the top-left corner of the screen. Any graphical primitive will be affected by the new viewport, and drawing outside specified region will produce no effect. If ##//color//## is specified, in the same format as the one supported by ##[[KeyPgColor Color]]##, the new viewport is cleared with it; if ##//border//## is specified, also in ##[[KeyPgColor Color]]## format, a box using ##//border//## as color will be drawn surrounding given region. If all arguments are omitted, the viewport is reset to the screen mode size.
- ""FreeBASIC's"" current behavior is to preserve the ##WINDOW## coordinates after calls to ##VIEW##, or when working on images, meaning that the coordinate mapping may undergo scaling/translations if the viewport changes. (If a ##WINDOW## hasn't been set, there is no coordinate mapping, and so it doesn't change after calls to ##VIEW##.) The behavior may change in future, but consistent behavior can be be assured over inconstent viewport coordinates by re-calling ##WINDOW## whenever you change the ##VIEW##.


Revision [14192]

Edited on 2009-07-06 09:54:03 by CountingPine [updated: formatting; todo: image buffers in description]
Additions:
- QBASIC preserves the ##WINDOW## coordinate mapping after subsequent calls to ##VIEW##.
- ""FreeBASIC's"" current behavior is to preserve the ##WINDOW## coordinates after calls to ##VIEW##, or when working on images, meaning that the coordinate mapping may undergo scaling/translations if the viewport changes. (If a ##WINDOW## hasn't been set, there is no coordinate mapping, and so it doesn't change after calls to ##VIEW##.) The behavior may change in future, but consistent behavior can be be assured over inconstent viewport coordinates by re-calling ##WINDOW## whenever you change the ##VIEW##.
Deletions:
- None


Revision [10199]

The oldest known version of this page was created on 2007-07-30 10:06:29 by JeffMarshall [updated: formatting; todo: image buffers in description]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode