Turbo-C
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
터보-C 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
Lua 게시판
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C/C++ Q/A
[3275] c에서 bmp파일 출력하는데 잘 안돼네요..
초보 [] 1558 읽음    2004-03-24 02:17
여기서 얻은 소스로 확인해볼려는데 뭔가를 찍긴 찍는거 같은데 흰색만 나오네요..
뭐가 잘못됐는지 모르겠어요..
아시는 분 부탁드려요..

#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);
}




+ -

관련 글 리스트
3275 c에서 bmp파일 출력하는데 잘 안돼네요.. 초보 1558 2004/03/24
3281     Re:c에서 bmp파일 출력하는데 잘 안돼네요.. 남병철.레조 1928 2004/03/24
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.