bmpconvert.cpp

来自「convert bitmap for vxworks use format」· C++ 代码 · 共 58 行

CPP
58
字号
// This is the main project file for VC++ application project 
// generated using an Application Wizard.

#include "stdafx.h"

//#using <mscorlib.dll>

//using namespace System;

extern int bmpInit (void);
//extern int bmpPrint(FILE *);
extern int bmpDecode (FILE *, FILE*);

char filename[256];
char fullname[256];
char outfilename[256];

int _tmain(int argc, char *argv[])
{
	FILE *fpi, *fpo;

	bmpInit ();
    // TODO: Please replace the sample code below with your own.
    //Console::WriteLine(S"Hello World");
	//printf ("This is using printf\n");

	if (argc < 2 )
	{
		printf ("Usage: bmpconvert bitmapFileName\n");
		return 0;
	}

	strcpy (filename,argv[1]);
	filename[0]= toupper (filename[0]);
	strcpy (fullname,argv[1]);
	strcat (fullname,".bmp");
	strcpy (outfilename,argv[1]);
	strcat (outfilename,".c");

	//printf ("%s %s\n", filename, fullname);

	if ( (fpi=fopen(fullname,"r")) == NULL)
	{
		printf ("***ERROR: File <%s> not found\n", fullname);
		return 0;
	}

	if ( (fpo=fopen(outfilename,"w")) == NULL)
	{
		printf ("***ERROR: File <%s> not found\n", outfilename);
		return 0;
	}

	bmpDecode (fpi,fpo);
	//bmpPrint ();

	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?