1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include <windows.h>
#include<stdio.h>
#pragma comment(lib,"CxImage.lib")
#pragma comment(lib,"jpeg.lib")
#include "ximage.h"
int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
CxImage image;
// bmp -> jpg
image.Load("Maria1.bmp", CXIMAGE_FORMAT_BMP);
if (image.IsValid())
{
if(!image.IsGrayScale()) image.IncreaseBpp(24);
image.SetJpegQuality(70);
image.Save("Maria1convertie.jpg",CXIMAGE_FORMAT_JPG);
printf("Conversion reussie\n");
}
else printf("Echec de la conversion\n");
return 0;
} |
Partager