Howdy, Stranger!

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

Categories

Screen Pixels

Josh CodeJosh Code Member Posts: 675
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

  • zibadianzibadian Member Posts: 6,349
    : 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.
  • pritaeaspritaeas Member Posts: 274
    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.

  • Josh CodeJosh Code Member Posts: 675
    : : 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?
  • zibadianzibadian Member Posts: 6,349
    : : : 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.
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    _________ { http://forcoder.org } free video tutorials and ebooks about | PHP, C, Python, Swift, Perl, Java, Ruby, MATLAB, Scratch, Delphi, JavaScript, Objective-C, Visual Basic, PL/SQL, C++, R, Assembly, Go, C#, Visual Basic .NET VBScript, Rust, Julia, ABAP, Bash, Transact-SQL, COBOL, SAS, Scheme, LabVIEW, Alice, Logo, Clojure, D, Hack, Prolog, Apex, Fortran, Erlang, Awk, Crystal, Ada, ML, FoxPro, Scala, F#, Lisp, Kotlin, Dart, Lua | ____

Sign In or Register to comment.