Cooker
December 19th, 2004, 03:23 AM
Hi,
I download the CxImage project from web(http://www.xdp.it/projects.htm).
I compile the jpeg projet and CxImage project to get the jpeg.lib and cximage.lib.
I include the all header file in CxImage project , jpeg.lib and cximage.lib.
Write the following source:
#include <windows.h>
#include "ximage.h"
#pragma comment(lib,"CxImage.lib")
#pragma comment(lib,"jpeg.lib")
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
CxImage image;
// bmp -> jpg
image.Load("C:\\image.bmp", CXIMAGE_FORMAT_BMP);
if (image.IsValid())
{
if(!image.IsGrayScale()) image.IncreaseBpp(24);
image.SetJpegQuality(70);
image.Save("C:\\image.jpg",CXIMAGE_FORMAT_JPG);
}
return 0;
}
and get the error
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(52) : error C2061: syntax error : identifier 'CxFile'
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(52) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(53) : error C2449: found '{' at file scope (missing function header?)
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(74) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2061: syntax error : identifier 'CxMemFile'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(127) : error C2061: syntax error : identifier 'CxImage'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(127) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(128) : error C2449: found '{' at file scope (missing function header?)
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(645) : error C2059: syntax error : '}'
Error executing cl.exe.
main.obj - 11 error(s), 0 warning(s)
I would like to conversion between bmp and jpeg.
What shall I do to complete the project???
Thank you! :)
I download the CxImage project from web(http://www.xdp.it/projects.htm).
I compile the jpeg projet and CxImage project to get the jpeg.lib and cximage.lib.
I include the all header file in CxImage project , jpeg.lib and cximage.lib.
Write the following source:
#include <windows.h>
#include "ximage.h"
#pragma comment(lib,"CxImage.lib")
#pragma comment(lib,"jpeg.lib")
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
CxImage image;
// bmp -> jpg
image.Load("C:\\image.bmp", CXIMAGE_FORMAT_BMP);
if (image.IsValid())
{
if(!image.IsGrayScale()) image.IncreaseBpp(24);
image.SetJpegQuality(70);
image.Save("C:\\image.jpg",CXIMAGE_FORMAT_JPG);
}
return 0;
}
and get the error
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(52) : error C2061: syntax error : identifier 'CxFile'
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(52) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(53) : error C2449: found '{' at file scope (missing function header?)
c:\program files\microsoft visual studio\myprojects\cximage\xfile.h(74) : error C2059: syntax error : '}'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2061: syntax error : identifier 'CxMemFile'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\xmemfile.h(7) : error C2059: syntax error : ':'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(127) : error C2061: syntax error : identifier 'CxImage'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(127) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(128) : error C2449: found '{' at file scope (missing function header?)
c:\program files\microsoft visual studio\myprojects\cximage\ximage.h(645) : error C2059: syntax error : '}'
Error executing cl.exe.
main.obj - 11 error(s), 0 warning(s)
I would like to conversion between bmp and jpeg.
What shall I do to complete the project???
Thank you! :)