Jump to content
  • Advertisement
Sign in to follow this  

Pixels in C#

This topic is 4775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to output a single pixel to the screen in pure C#, with no libraries or anything (no DirectX or OpenGL, etc.)? If so, what is the cleanest and quickest way to do so? And if there is some way, is it portable to other platforms or operating systems, or no? Any way to make it so? I'm not sure if this is possible but I am interested.

Share this post

Link to post
Share on other sites
Im assuming you dont mean without even the windows libraries.
Otherwise I cant really surely give you an answer.
With no libraries whatsoever im not sure but Id say probably not, becuase c# is a language mainly made for .net if Im not mistaken so why not use the .NET libraries?
You will probably always need something to comunicate with the operating system telling it to show certain imagery.

If you mean only the .net frameowrk then:
Its a simple control you can pull onto the window in vs .net calles a PictureBox.
You can use the picture box in te code by assigning it a bitmap:
someImage = new Image(width, height);

/here we draw to the screen
mypb.Image = someimage; //someimage is of type Image

Thats all.
As for cross platform: c# in itself isnt really cross platform although there are things in development like (mono if im not mistaken for linux).


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!