Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Altera Monitor VGA

Altera_Forum
Honored Contributor II
1,130 Views

I am trying to write a program in C which will read a .bmp file and then draw that image on a monitor pixel by pixel. I am not sure how to read the pixel values from the bmp file. 

 

I know there are some libraries such as Allegro which can be used for this purpose, but whenever I declare this header file in my C program, I get the error: "No such file or directory". 

 

What is the most simplest way to output an image onto the screen?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
316 Views

Hi singhda8; have you found anything regarding printing on screen (VGA) an image (bitmap)? 

Many tnx
0 Kudos
Altera_Forum
Honored Contributor II
316 Views

It might be easiest to separate the tasks of reading an image file and displaying the image (and also getting the image from filestore into fpga memory). 

To get the display working I'd just fill the display memory with a known pattern - either at compile time, or with some run time loops - and get that displayed properly. 

 

Reading a .bmp file either requires some libraries, or an in-depth knowledge of the actual file format. In either case you'll need to arrange for the relevant code and headers (etc) be present in the nios build (if that is where you are decoding the file). 

A google (or other) search will soon find something. 

 

Getting acces to the file is a problem in itself - can you actually justify the presence of the JTAG debug interface and the host-side debugger giving you access to the host's filesystem??
0 Kudos
Altera_Forum
Honored Contributor II
316 Views

Mabye you won't believe me, but it's a long time since I'm trying to find out something from googling everywhere. 

 

I cannot find anything in Altera's site or elsewhere... regarding loading images in memory or using VGA ;-( 

 

I created a NIOS 2 cpu with VGA, SRAM, ... it seems all to work fine  

 

Until now, I can refresh all my SRAM addressing space (for example setting it to 0xff value in order to let all the screen became white) and print one pixel; now I've to load bitmap file in SRAM and then print it. 

 

Any suggestion? 

 

Many thanks in advance.
0 Kudos
Reply