Howdy, Stranger!

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

Categories

pixel manipulation

hotsummerhotsummer Member Posts: 70
There must be someone out thewre that can help me on this!

How can I manipulate a single pixel on a computer monitor using either C++ or Java, whether the pixel is in a window or not. For example, change the color of the pixel at position (x, y) to the color (r, g, b).

It really can't be that difficult to do since that is the basics of all graphical programming. I will appreciate it very much if I can get some direction form someone.

Comments

  • mfroebmfroeb Member Posts: 53
    : There must be someone out thewre that can help me on this!
    :
    : How can I manipulate a single pixel on a computer monitor using either C++ or Java, whether the pixel is in a window or not. For example, change the color of the pixel at position (x, y) to the color (r, g, b).
    :
    : It really can't be that difficult to do since that is the basics of all graphical programming. I will appreciate it very much if I can get some direction form someone.
    :

    Just use the windows API function SetPixelV(hdc,x,y,color) to set the pixel. this is generic for all windows programming languages. other languages may introduce language-specific concepts, but i do not program in c++ or java.

    if the pixel is not in a window, get the hdc of the desktop by calling the api function for getting the hdc of any window (hwnd) and pass 0 as the hwnd parameter. then call setpixelv(...) and set a pixel of the desktop. just don't forget to call ReleaseDC(desktophdc) when finished.
  • Shawn CarterShawn Carter Member Posts: 0

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

Sign In or Register to comment.