TSCARBitmap.SaveToJpeg

From SCAR Divi Manual
Revision as of 02:31, 4 November 2012 by Freddy (talk | contribs) (Created page with "==Definition== Member of TSCARBitmap.<source lang="scar" lines="false"> function TSCARBitmap.SaveToJpeg(const Path: string; const Quality: Integer): Boolean; </source> ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

Member of TSCARBitmap.
function TSCARBitmap.SaveToJpeg(const Path: string; const Quality: Integer): Boolean;

Availability

SCAR Divi 3.35 > Current

  • Before 3.37 the target folder would not automatically be created.

Description

Saves a bitmap to a JPEG file with it's path specified by Path. Quality specifies the compression quality of the saved file from 1 to 100, with 100 being the best quality. If the target folder does not exist, it will be created by the function.

Example

var
  Bmp: TSCARBitmap;
  
begin
  Bmp := TSCARBitmap.Create('deNrtkttOg0AYhPsa+v7P0JhQEFhOCxQQdjmVQ' +
    'qHVG2M93zuRxDv/psKFF02+TCazw2QJXC+uFln9dOGf44SN6RYj8BPXDCdP5CH' +
    'KBij8xDXdluu09+MWCj9x7dYSQdI5QY1B+L+NMF5pLBvh0dbiJfQnwelZa0G6V' +
    '80Ub4cR2690WwDDkfDIcXru9fy7QdETb90oejzCvAIJcuIpsfmVIMVgbPFiZWA' +
    'qh0dC9L85EuAmN2pouhIKT5eBbE4QYFALoSebIN8+z0jRvhBk9SPjpWalUHi6D' +
    'KqOAp/A8qTNc+YKeLoM6t0rgWompiuWiqexBJ4ug03/RmD7JXYUPVwZETxdBs3' +
    'wTlC2R/y0mILC02XQ7uekO3zMyO7+c0b6hzn5Ao/jnYI=');  
  try
    Bmp.SaveToJpeg(ScreenPath + 'Test.jpg', 75);
    Bmp.Clear(clBlack);
    Bmp.LoadFromJpeg(ScreenPath + 'Test.jpg');   
    DebugBitmap(Bmp);
  finally
    Bmp.Free;
  end;
end.

See Also