|
FastPoint | |
RgbColour = FastPoint(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 FastPoint() function reads the RGB colour value of any selected pixel, much like the Point() function. But, that's where the similarity ends. Unlike Point however, FastPoint has it's safety code removed to make it faster! This means two things, it can only read pixels from a surface that has been locked by Lockbuffer and that it has no clipping. Therefore it assumes the coordinate of the pixel you wish to read, will be inside the screen bounds. Note: Before you can use FastPoint correctly. After you lock the draw surface, it's hihgly recommended you read a pixel from this surface using Point(). This will ensure the address of the surface is seeded for FastPoint Any Improper use of this command may cause your program to crash ! FACTS: * FastPoint has no clipping. So the coordinate you give it must be legal, or you should expect your program to crash! * FastPoint() requires that the surface your reading from be locked prior to reading. * FastPoint() 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 your reading from, 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 for reading, Which is controlled by the OS. 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 + for 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, FastPoint() will most likely crash ! |
|
Example Source: Download This Example
|
Related Info: | Dot | DotC | FastDot | GetInk | GetInkB | GetInkG | Ink | Point : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |