1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 17:01:21 +00:00
QB64-PE/internal/help/_CLIP.txt

50 lines
1.9 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_CLIP}}
The '''_CLIP''' option is used in a QB64 graphics [[PUT (graphics statement)|PUT]] to allow placement of an image partially off of the screen.
{{PageSyntax}}
2016-03-18 11:36:04 +00:00
:[[PUT (graphics statement)|PUT]] [STEP](column, row), ''image_array(start)''[, '''_CLIP'''] [{XOR|PSET|AND|OR|PRESET}][, ''omitcolor'']
{{PageDescription}}
* _CLIP should be placed immediately before the PUT action if used. XOR is default when not used.
* The offscreen portions of the image will be the omit color.
2016-03-18 11:36:04 +00:00
* [[GET (graphics statement)|GET]] can get portions of the images off screen in '''QB64'''.
''Example:'' Placing an image partially or fully offscreen.
{{CodeStart}}'' ''
{{Cl|DIM}} mypic(500)
{{Cl|SCREEN}} 13
{{Cl|CLS}}
{{Cl|CIRCLE}} (10,10),10
{{Cl|GET (graphics statement)|GET}} (0,0)-(20,20), mypic(0)
{{Cl|PRINT}} "This program puts an image off screen."
{{Cl|PRINT}} "Select which option you'd like to try."
{{Cl|PRINT}} "1 will produce an illegal function call."
{{Cl|PRINT}} "1 is putting without _CLIP."
{{Cl|PRINT}} "2 is putting with _CLIP PSET."
{{Cl|PRINT}} "3 is putting with _CLIP XOR."
{{Cl|PRINT}} "4 is putting with _CLIP PSET, 4."
{{Cl|INPUT}} sel
{{Cl|IF...THEN|IF}} sel = 1 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), PSET ' this causes an illegal function call
{{Cl|IF...THEN|IF}} sel = 2 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), {{Cl|_CLIP}} PSET ' allows graphic to be drawn off-screen
{{Cl|IF...THEN|IF}} sel = 3 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), {{Cl|_CLIP}} ' uses the default PUT XOR operation
{{Cl|IF...THEN|IF}} sel = 4 {{Cl|THEN}} {{Cl|PUT (graphics statement)|PUT}} (-10, 10), mypic(0), {{Cl|_CLIP}} PSET, 4 ' doesn't draw red pixels
{{Cl|END}} '' ''
{{CodeEnd}}
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[PUT (graphics statement)]]
* [[GET (graphics statement)]]
* [[STEP]]
{{PageNavigation}}