By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

How to draw an infinitely scalable image that consists of pixels and text

P: 7

currently I am working on the following scenario:

There is a device connected to my application. That device has a 256x256 pixel display showing graphics and text.

Now for each pixel of that display I receive a flag whether the pixel is to be drawn or not.
Furthermore to display text you can imagine the surface as divided in 21 columns and 16 rows. Now for each cell I get information whether some letter is to be displayed in that cell or not.

By combining these two information I shall be able to draw the device display in any .NET application as if the user was directly watching the device itself.

Now of course it is easy to restrict the application to a client size of 256x256 and just draw every pixel. Once I found a font and font size to fit 21 columns and 16 rows I am good.

But that wont do it as the user wants to be able to scale the display infinitely(however I will force him to keep the aspect ratio).

Now I am evaluating what approach might be the best.
The easiest I can imagine is just draw that 256x256 image and then scale that bitmap using .NETs build in methods. But that might get pretty ugly.. especially for the text artefacts.

I dont know if WPF offers some handy way to manage this?

Thank you!

Nov 17 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.