Create a sprite programatically in .NET?

Hi;

I've struck out trying to get an answer to this in the .net forums. Is there a way to create a Bitmap object in .net where the bitmap is all 100% transparent (alpha) I can then draw lines, text, etc. on the bitmap and where I do not draw, it remains transparent.

thanks - dave




Answer this question

Create a sprite programatically in .NET?

  • Mike95

    Just to clarify, "all from .Net" and "all in GDI" is not the same thing. Managed DirectX is a 100% managed API so you could use DirectX and still stay "all in .Net".

  • gamemaker9

    Look at the Simple2D sample inside the DirectX SDK.  You should get an idea of what to do from that example.

  • Frederic Bellier

    Hmmm, I reread your question. Are you trying to do this purely within GDI code or is using DirectX acceptable to you

  • DesX

    Great - thank you!

  • andy0203

    There is a sprite2d sample in c# also.

  • DuckPuppy

    Hi;

    Sorry, one caveat. We presently are 100% managed code which is a big plus in terms of security. Is there a way to do this within .net

    thanks - dave



  • ooKmonkey

     

    If you are using GDI+ and windows forms, here is a good FAQ site for you. Bob has done a lot of work with GDI+ and the site should at least lead you in the right direction.



  • dops141441

    Hi;

    Yes, purely within .net code. We don't have to have this functionality (we just draw a white background now) and it is very good from a security point that all of our code only calls the .net API.

    thanks - dave



  • Create a sprite programatically in .NET?