여기서 얻은 소스로 확인해볼려는데 뭔가를 찍긴 찍는거 같은데 흰색만 나오네요..
뭐가 잘못됐는지 모르겠어요..
아시는 분 부탁드려요..
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<dos.h>
#include<graphics.h>
#define WIDTH 320
#define HEIGHT 200
void main(void)
{
int x,y,k,ix,iy,midx,midy;
unsigned int i,input;
int gd=DETECT,gm;
FILE *fp;
fp=fopen("c:\\bmp\\FINAL.BMP","r");
initgraph(&gd,&gm," ");
midx=getmaxx()/2;
midy=getmaxy()/2;
ix=midx-WIDTH/2;
iy=midy+HEIGHT/2;
rewind(fp);
for(k=1;k<=1078;k++) // 8bit (256 color) BMP Hearder
input=fgetc(fp);
for(y=0;y<HEIGHT;y++){
for(x=0;x<WIDTH;x+=1){
input=fgetc(fp);
putpixel(ix+x,iy-y,input);
}
}
getch();
closegraph();
fclose(fp);
}
|