Altera_Forum
Honored Contributor
19 years agoHow to store a BMP file to nios board from a PC
Hi
I am using the Apex20kE device I got a problem to load a bmp file to the Nios development board. Here is my code # include <stdio.h># include <nios.h> # define K 12960 main(void) { FILE *fp; char p[K]; int i; fp=fopen("d:\\picture.bmp","rb" ) ; if (fp==NULL) { printf("Can not open file.\n"); exit(1); } fgets(p,K,fp); fclose(fp); for(i=0;i<K;i++) printf("%8x,",p[i]); return 0; } Well ,it doest work I don't want to write the image pixel by pixel Is there anyone who can help me?