mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-28 11:17:47 +00:00
49 lines
1.9 KiB
Text
49 lines
1.9 KiB
Text
{{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}}
|
|
:[[PUT (graphics statement)|PUT]] [[[STEP]]]({{Parameter|column, row}}), {{Parameter|image_array(start)}}[, [[_CLIP]]] [{XOR|PSET|AND|OR|PRESET}][, {{Parameter|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.
|
|
* [[GET (graphics statement)|GET]] can get portions of the images off screen in '''QB64'''.
|
|
|
|
|
|
{{PageExamples}}
|
|
''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}}
|
|
* [[PUT (graphics statement)]]
|
|
* [[GET (graphics statement)]]
|
|
* [[STEP]]
|
|
|
|
|
|
{{PageNavigation}}
|