draw_getpixel


描述

With this function you can get the colour value of any pixel that is being drawn to the current render target. This means that the results will depend on the event in which the function is called, and also on the target surface being used. Note that this will not return any alpha values, for that you should use draw_getpixel_ext.

NOTE: This function is incredibly slow and so should only be used when absolutely necessary.


语法:

draw_getpixel(x, y);


参数 描述
x 表面上的x坐标,用于获取对应的像素。
y 表面上的y坐标,用于获取对应的像素。


Returns:

实数


例如:

draw_set_colour(draw_getpixel(500,200));

The above code will set the drawing colour for all text, forms and primitives to the colour of the pixel at (500,200) on the game screen.