Jump to content
  • Advertisement
Sign in to follow this  
ChristOwnsMe

Ascii image to texture

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

Hello. I want to be able to convert an ascii file into a texture, where the texture is composed of the characters in the ascii file. For instance, if I had a  3x3 ascii file that looked like this.

 

@@@

@@@

@@@

 

I want to be able to generate a texture that is some given size, say 512x512, that has those 9 ascii characters on the texture(with the same rows and columns). I have not been able to think of a good way to do this, and I need to be able to do it dynamically. Any ideas? Thanks.

Share this post


Link to post
Share on other sites
Advertisement

If you are using XNA you can draw a string with the normal SpriteBatch to a specific RenderTarget and then store it in a Texture2D.

You can even save it as JPG oder PNG with one line.

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!