Home > Back-end >  For cmyk color mode how to BMP JPG figure figure? Under delphi7
For cmyk color mode how to BMP JPG figure figure? Under delphi7

Time:09-16

The function JpgToBmp (JPGpicLocation, BMPpicLocation: string) : Boolean;
Var
JpegImg: TJpegImage;
Bitmap: TBitmap;
The begin
Result:=False;
JpegImg:=TJpegImage. Create;
Try
JpegImg. LoadFromFile (JPGpicLocation);
Bitmap:=TBitmap. Create;
Try
Bitmap. Assign (JpegImg);
Bitmap. SaveToFile (BMPpicLocation);
Result:=True;
The finally
Bitmap. Free
end;
The finally
JpegImg. Free
end;
end;

The above code can take most of the RGB JPG to BMP, but not CMYK mode

CodePudding user response:



Is this a

CodePudding user response:

The TImage displays the figure is normal

CodePudding user response:

Delphi7 showed no, which version are you using?

refer to the second floor DelphiGuy response:
the TImage displays the figure is normal


Delphi7 showed no, which version are you using?

CodePudding user response:

10.2...

CodePudding user response:

reference 4 floor DelphiGuy response:
10.2...


The version should be no problem, now only discuss under DELPHI7

CodePudding user response:

 procedure TForm1. Button1Click (Sender: TObject); 
Var
Jpeg: TJPEGImage;
BMP: TBitmap;
The FileName, FileName1: string;
The Begin
FileName:='D: \ 2. JPG';
FileName1:='D: \ 2. BMP';
Image1. Picture. LoadFromFile (Filename);
Jpeg:=TJPEGImage. Create;
Try
Jpeg. LoadFromFile (filename);
BMP:=TBitmap. Create;
Try
BMP. Assign (jpeg);
BMP. SaveTofile (filename1);
The finally
BMP. Free
end;
The finally
Jpeg. Free
end;
Image2. Picture. LoadFromFile (Filename1);
end;

Successful transformation test under the D7,

CodePudding user response:

D7 displays the color # 1 normal...

CodePudding user response:

refer to 6th floor lyhoo163 response:
 procedure TForm1. Button1Click (Sender: TObject); 
Var
Jpeg: TJPEGImage;
BMP: TBitmap;
The FileName, FileName1: string;
The Begin
FileName:='D: \ 2. JPG';
FileName1:='D: \ 2. BMP';
Image1. Picture. LoadFromFile (Filename);
Jpeg:=TJPEGImage. Create;
Try
Jpeg. LoadFromFile (filename);
BMP:=TBitmap. Create;
Try
BMP. Assign (jpeg);
BMP. SaveTofile (filename1);
The finally
BMP. Free
end;
The finally
Jpeg. Free
end;
Image2. Picture. LoadFromFile (Filename1);
end;

Successful transformation test under the D7,


Can you turn this code under the D7 RGB mode of JPG figure, but CMKY not line, you can try me upstairs to provide pictures

CodePudding user response:

Write a DLL, can use the high version D7 call,

CodePudding user response:

ImageEnView1. IO. LoadFromFile (' C: \ Users \ lenovo \ Desktop \ 1532053124 _584114. JPG ");
ImageEnView1. IO. SaveToFileBMP (' C: \ Users \ lenovo \ Desktop \ 1. BMP ');
It is ok to use imageenview to do
  • Related