473,387 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

draw text values

Suppose we have:
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
How can I display these pixels value on the dialog screen to be black/white picture like this??

Expand|Select|Wrap|Line Numbers
  1. ████
  2. █  █
  3. █  █
  4. ████
Mar 25 '07 #1
4 1681
Suppose we have:
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
How can I display these pixels value on the dialog screen to be black/white picture like this??

████
█ █
█ █
████

(How) Can I use GDI or GDI+ or MFC class to draw the 2D array values to image shown on the windows dialog??
Mar 26 '07 #2
RedSon
5,000 Expert 4TB
(How) Can I use GDI or GDI+ or MFC class to draw the 2D array values to image shown on the windows dialog??
Yes you can use GDI functions to draw images to the screen. That is what GDI is for. You want to look at brushes, pens, rectangles, regions and filled shapes.

http://msdn.microsoft.com/library/de...start_9ezp.asp
Mar 26 '07 #3
Yes you can use GDI functions to draw images to the screen. That is what GDI is for. You want to look at brushes, pens, rectangles, regions and filled shapes.

http://msdn.microsoft.com/library/de...start_9ezp.asp
I am newbie. I am frustrated. Which function I should use in GDI to draw the values in 2D array to DC in window dialog ??
Mar 27 '07 #4
RedSon
5,000 Expert 4TB
Did you look at the site I identified for you? Did you click on the filled shapes section? In that section it shows the code for creating a sample application. In windows all drawing to the device context is done in the WM_PAINT message handler. So if you look in there you will see that there is a method called Rectangle(...). I'd say that, that method is a pretty good place to start.

If you are a n00b, GDI may not be the place to start for you. It is difficult to get it to do what you want. Try console output first and print ones and zeros, then you can modify your application to use █ and whitespace if you want. Then you can try building a win32 application to support that drawing. But keep in mind building a win32 program goes from 1 class and about 100 lines of code to 2 or more classes and about 800-1000+ lines of code.
Mar 27 '07 #5

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

Similar topics

0
by: Florida Draw | last post by:
------=_NextPart_000_0012_1D5428A2.65C196F8 Content-Type: text/plain Content-Transfer-Encoding: 8bit Sign-up for the FREE Holiday Giveaway Draw You must register to be eligible for the draw....
6
by: R | last post by:
Hello everybody! I'm newbie to JavaScript and I have a basic question. I have X and Y coordinates of A and B points. How can I draw a line connecting A and B? thanks in advance cheers
2
by: michael Dorrian | last post by:
Could someone tell me an efficient way to draw text onto the screen. In my application i can draw at 600dpi,400dpi or 300dpi. The trouble is when text is large or the textbox is large then editing...
2
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
0
by: news | last post by:
If anyone can recommend a more appropriate newsgroup for this question? We recently upgraded from php 4.1.2 to php 4.3.9 and ImageMagick 5.5.7 to version 6.2.5. I have a script that creates a...
3
by: Luis Arnauth | last post by:
Hello, I've got a small aplication where i design a small scheme using System.Drawing. I need to use a NumericUpDown control to change some text i've draw. I have all the code under:...
3
by: rengaraj | last post by:
Dear Experts, I want to read a text file containing values. From these text values, an Excel chart has to be drawn. I read the file contents and hold in buffer but how to put values into an...
2
by: Chetana | last post by:
Hi , I have created one application which has multiple lat and lon values . I want to draw a polyline for those point .I am not using google map so I want function in javascript to draw line....
4
by: HoangTuanSu | last post by:
I have just got a javascript code from my friend. I've modified it for my purpose but a problem happens. First, here's my code html <body> <table align="center" width="60%" height="100%"...
1
by: martinsmith160 | last post by:
Hi all I am trying to create a level builder tool for a final year project and im having some problems drawing. I have placed a picture box within a panel so i can scroll around the image which is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.