Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

C++ matrix saving as a picture.

Status
Not open for further replies.

shsshs

Newbie level 5
Joined
Jul 25, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
turkiye
Activity points
1,356
I am writing c++ code and output of the code comes as a matrix. I wonder can I visualize this matrix and save as a image by using c++? My matrix elements only 1 or zero. As a result of this I want to obtain picture compose of black and white squares. Is it possible to write code to create such a picture?
 

Probably simplest is the bmp file format.

You can Google for example for C++ write bitmap. Although most solutions use already provided functions from for exaple the visual studio devlopment platform. Another solution siggests the ImageMagic libraries.

Maybe the best solution is to look at the Bitmap file structure, and just create a bitmap file. See for example BMP file format - Wikipedia, the free encyclopedia

Stefaan
 

Usually, an image is a matrix of integer numbers from 0 to 255 (if it is an 8-bit image). The matrix is always in the form of R,G,B channels which determines the color cell of each matrix. Try searching in the internet ways of extracting colors into a matrix, and like what others said, start with a .bmp extension.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top