{$IFDEF COMPONENT_SET_LCL}
// Create 32bit raw image from image data
FillChar(RawImage, SizeOf(RawImage), 0);
with RawImage.Description do
begin
Width := WorkData.Width;
Height := WorkData.Height;
BitsPerPixel := Info.BytesPerPixel * 8;
Format := ricfRGBA;
LineEnd := rileByteBoundary;
BitOrder := riboBitsInOrder;
ByteOrder := riboLSBFirst;
LineOrder := riloTopToBottom;
AlphaPrec := 8;
RedPrec := 8;
GreenPrec := 8;
BluePrec := 8;
AlphaShift := 24;
RedShift := 16;
GreenShift := 8;
BlueShift := 0;
Depth := 24;
end;
RawImage.Data := WorkData.Bits;
RawImage.DataSize := WorkData.Size;
// Create bitmap from raw image
{ If you get complitation error here upgrade to Lazarus 0.9.24+ }
if RawImage_CreateBitmaps(RawImage, ImgHandle, ImgMaskHandle, False) then
begin
Bitmap.Handle := ImgHandle;
Bitmap.MaskHandle := ImgMaskHandle;
end;
{$ENDIF}
QuoteThe size of Tigers-1.jpg is 888KB
ImgJpeg := TImagingJpeg.Create;
InitImage(ImgData);
LoadImageFromFile('img002.jpg', ImgData);
SaveImageToFile('img002-1.jpg', ImgData);
ImgJpeg.AssignFromImageData(ImgData);
ImgJpeg.SaveToFile('img002-2.jpg');
Image1.Picture.Graphic := ImgJpeg;
Image1.Picture.SaveToFile('img002-3.jpg');
Image1.Picture.LoadFromFile('img002.jpg');
...
Image1: TImage;
FBitmap1: TImagingBitmap;
FImage1: TMultiImage;
...
FImage1 := TMultiImage.Create;
FBitmap1 := TImagingBitmap.Create;
Image1.Picture.Graphic := FBitmap1;
FImage1.LoadMultiFromFile('Tigers.jpg');
Image1.Picture.Graphic.Assign(FImage1);
Image1.Picture.SaveToFile('Tigers-1.jpg');
FImage1.SaveToFile('Tigers-2.jpg');
Page created in 0.035 seconds with 19 queries.