Difference between revisions of "CLIPBOARDIMAGE"

From QB64 Wiki
Jump to navigation Jump to search
imported>SMcNeill
m (-)
m (Nomalise Availability section text)
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
  
  
==Availability==
+
{{PageAvailability}}
* '''Build 20170906/64''' onward.
+
* Build 20170906/64 and up.
  
  
Line 51: Line 51:
 
{{PageSeeAlso}}
 
{{PageSeeAlso}}
 
* [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] {{text|(function - used to paste an image from the clipboard)}}
 
* [[_CLIPBOARDIMAGE (function)|_CLIPBOARDIMAGE]] {{text|(function - used to paste an image from the clipboard)}}
* [[_CLIPBOARD$]], [[_CLIPBOARD$ (function)]] {{text|(used to copy/paste text)}}
+
* [[_CLIPBOARD$]], [[_CLIPBOARD$ (statement)]] {{text|(used to copy/paste text)}}
  
  
 
{{PageNavigation}}
 
{{PageNavigation}}

Latest revision as of 03:20, 8 March 2021

The _CLIPBOARDIMAGE statement copies a valid QB64 image to the clipboard.


Syntax

_CLIPBOARDIMAGE = existingImageHandle&


Description


Availability

  • Build 20170906/64 and up.


Examples

Example: Create a sample image and copy it to the clipboard:

SCREEN _NEWIMAGE(800, 600, 32) 'Create image in memory: canvas& = _NEWIMAGE(300, 200, 32) _DEST canvas& 'Draw some random rectangles: RANDOMIZE TIMER FOR i = 1 TO 100 LINE (-100 + RND * _WIDTH, -100 + RND * _HEIGHT)-STEP(RND * 150, RND * 150), _RGB(RND * 255, RND * 255, RND * 255), BF NEXT LINE (0, 0)-(_WIDTH - 1, _HEIGHT - 1), _RGB(255, 255, 255), B COLOR _RGB(0, 0, 0), _RGB(255, 255, 255) m$ = " Hello, world! " _PRINTSTRING (_WIDTH / 2 - _PRINTWIDTH(m$) / 2, _HEIGHT / 2 - _FONTHEIGHT / 2), m$ 'Show the image: _DEST 0 _PUTIMAGE (_WIDTH / 2 - _WIDTH(canvas&) / 2, _HEIGHT / 2 - _HEIGHT(canvas&) / 2), canvas& PRINT "Image generated." 'Copy to the clipboard: _CLIPBOARDIMAGE = canvas& PRINT "Image copied to clipboard."

Code by Fellippe Heitor


See also



Navigation:
Keyword Reference - Alphabetical
Keyword Reference - By Usage
Main Wiki Page