Jump to content
  • Advertisement
Sign in to follow this  
ed209

[.net] GDI+ pixel

This topic is 3899 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

I'm trying to draw a pixel in GDI+ but theres no function for it. Theres one for drawing rectangles, circles, arcs, but no drawpoint. Does anyone know how I can accomplish this? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Come on man, how many of your threads are going to be about drawing pixels? Me and many others have already told you how to, in many different APIs as well. Also what's with all the API changes? First it was MDX, then OpenGL, then MDX again and now it's GDI+?

Seriously just pick your favorite API and got on with it.

To answer your question though, the fastest method would be to create a Bitmap and then write to it. However since writing and locking is expensive, you should "draw" to an array and then just write the whole array to the Bitmap. This should sound familiar since it's the same technique as in DirectX and openGL, just with a Bitmap in place of a texture.

Share this post


Link to post
Share on other sites
System.Drawing.Bitmap has a SetPixel method, but it is slow.

You should tell us what you're trying to do, because raw pixel access is rarely, rarely ever needed. That's why most ways of doing it are slow, because it's just not an important enough task to provide an easy means of doing it quickly.

Share this post


Link to post
Share on other sites
Quote:
Original post by Scet
Come on man, how many of your threads are going to be about drawing pixels? Me and many others have already told you how to, in many different APIs as well. Also what's with all the API changes? First it was MDX, then OpenGL, then MDX again and now it's GDI+?

Seriously just pick your favorite API and got on with it.


I wasn't told how to draw to a texture using Managed Directx, only to use rendertosurface class. I tried OpenGL, but VB isn't good for that. Now I'm trying GDI+ but it's too slow to draw a point.

Share this post


Link to post
Share on other sites
Quote:
Original post by ed209
I wasn't told how to draw to a texture using Managed Directx, only to use rendertosurface class.


Really? Because I seem to remember sending you a PM detailing how to write to both SDL surfaces and DirectX textures. Actually drawing the texture or surface is trivial and could be found with a simple Google search.

Quote:
Original post by capn_midnight
You should tell us what you're trying to do, because raw pixel access is rarely, rarely ever needed.


If you look through his posts you'll see he's trying to make an emulator. For which system now I'm not sure. Initially it was for the NES, but that would be far too difficult for him so we suggested the CHIP-8. However at this stage it looks like looking up a simple tutorial is difficult.

I know my posts here sound kind of harsh, but I've responded to many of this guys posts and even shared source code with him through PMs and at this point it's like talking to a brick wall. His threads all die out because he rarely responds to them and then a week later we get the same question with a different API. We're here to help you ed209, but you're not giving us a lot to work with.

Share this post


Link to post
Share on other sites
Quote:
Original post by Scet
Come on man, how many of your threads are going to be about drawing pixels? Me and many others have already told you how to, in many different APIs as well. Also what's with all the API changes? First it was MDX, then OpenGL, then MDX again and now it's GDI+?



Originally, I asked how to draw to a texture in managed directx and was told to search for rendertosurface. I found a tutorial that shows you how to render to a texture in managed directx but I didn't know how to write an array to the texture.

It was suggested in one of my threads that I just use GDI+ because directx would be overkill unless I wanted to be able to resize the window. So I figured out how to draw shapes to a bitmap in GDI+, but still didn't know how to draw points to the bitmap. Isn't that what you mean by writing an array to a texture or bitmap - drawing an array of pixels?

I'm trying here, man.

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!