Screen Pixels

Is there a way of getting direct access to screens pixels? Is there a way of getting a pointer to where the screens pixel information is stored?
Also why is using the canvas.pixels property so slow? If you use an array of array of tcolor it is much faster to access the values.

Comments

  • : Is there a way of getting direct access to screens pixels? Is there a way of getting a pointer to where the screens pixel information is stored?
    : Also why is using the canvas.pixels property so slow? If you use an array of array of tcolor it is much faster to access the values.
    :
    You cannot access the complete screen from any program, just the part bounded by its window. This is due to the way the screen is displayed.
    The speed of the canvas depends on which canvas you are using, and if that canvas already has a handle.
  • Hmm, try the GetDC(0) API function. You'll get a handle to the desktop. If you paint here, it gets drawn over anything that is on your screen.

    hth, pritaeas

    : You cannot access the complete screen from any program, just the part bounded by its window. This is due to the way the screen is displayed.

  • : : Is there a way of getting direct access to screens pixels? Is there a way of getting a pointer to where the screens pixel information is stored?
    : : Also why is using the canvas.pixels property so slow? If you use an array of array of tcolor it is much faster to access the values.
    : :
    : You cannot access the complete screen from any program, just the part bounded by its window. This is due to the way the screen is displayed.
    : The speed of the canvas depends on which canvas you are using, and if that canvas already has a handle.
    :

    Can you get direct access to a window's pixels then? Why wouldn't the pixel information be accessable in the same way as a bitmap's canvas by using ScanLine?
  • : : : Is there a way of getting direct access to screens pixels? Is there a way of getting a pointer to where the screens pixel information is stored?
    : : : Also why is using the canvas.pixels property so slow? If you use an array of array of tcolor it is much faster to access the values.
    : : :
    : : You cannot access the complete screen from any program, just the part bounded by its window. This is due to the way the screen is displayed.
    : : The speed of the canvas depends on which canvas you are using, and if that canvas already has a handle.
    : :
    :
    : Can you get direct access to a window's pixels then? Why wouldn't the pixel information be accessable in the same way as a bitmap's canvas by using ScanLine?
    :
    Most window's don't have a canvas. They are drawn directly to the screen by windows. For example: a TEdit is drawn by a number of API calls.
    You cannot use ScanLine on a window, because it is continuously redrawn in its reverse Z-order. This means that while you are processing the ScanLine, it is being changed by windows itself.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories