Cita:
Empezado por Neftali [Germán.Estévez]
|
Como puedo aplicar este código a mi proyecto ya que la imagen la tengo en IMAGE1.BITMAP
Código Delphi
[-]var
NewBitmap: TBitmap;
MS1 : TMemoryStream;
Surf: TBitmapSurface;
JpgQuality : TBitmapCodecSaveParams;
begin
NewBitmap := TBitmap.CreateFromFile('input.bmp');
MS1 := TMemoryStream.Create;
Surf := TBitmapSurface.create;
try
MS1.Position := 0;
Surf.Assign(NewBitmap);
JpgQuality.Quality := 100;
if not TBitmapCodecManager.SaveToStream(MS1, Surf, '.jpg', @JpgQuality) then
raise EBitmapSavingFailed.Create('Error saving Bitmap to jpg');
MS1.SaveToFile('ouput.jpg');
finally
NewBitmap.Free;
MS1.Free;
Surf.Free;
end;
end;
ya logre solucionar el problema que tenía con el JPEG tuve que agregar estos USES
Código Delphi
[-]System.ImageList, FMX.Surfaces