Point
RgbColour = Point(Xpos, Ypos)
 
Parameters:

    Xpos = The X coordinate of where to read this pixel colour from
    Ypos = The Y coordinate of where to read this pixel colour from
Returns:

    RgbColour = The Colour of this pixel in RGB format
 

      The Point() function will read the RGB colour of any selected pixel.



FACTS:


      * Point() returns the pixel color in RGB format. Where each R,G,B component has a 0- 255 range. Use the RGBR(), RGBG(), RGBB() functions to calc the R,G,B values

      * Reading lots of Dots from the screen or an image manually can be very slow. The reason for this is that each time you read or write a single dot, the surface has to first be locked, then the pixel is read and then unlocked again. The locking is required to ensure that the surface is valid. So when your reading or writing lots of pixels, your constantly locking/unlocking the surface. Which will be extremely slow! To overcome this, See LockBuffer + UnLockbuffer + FastPoint for a little more speed.

      * It's important to note also that colour RGB values can be affected by the current screen mode your program is running in. In particular if your program is running in 16bit mode. In which case, some finer colour accuracy will be lost.

      * If you attempt read a pixel outside of the current drawing surfaces size, Point() will return a zero.




Mini Tutorial:


      Reading a Point and display it as integer value and then as a hex value.

  
  
; Clear the Screen to a bright Red-ish colour.
  Cls $f00020
  
; Read any pixel from the screen
  ThisColour = Point(100,100)
  
; Display the colour value
  Print Point(100,100)
  
; Display the colour value in hex format
  Print Hex$(Point(100,100))
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  15728672
  $00f00020
  

 
Related Info: Dot | DotC | FastDot | FastPoint | GetInk | GetInkB | GetInkG | Ink | LockBuffer | PixelRunLength | UnLockBuffer :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com