Compressed image file and convert to BMP format

zhaozj2021-02-16  58

Function graphictobmp (p: tpicture; qualy: integer = 80): Tbitmap;

VAR

JPG: TJPEGIMAGE;

Begin

Result: = Tbitmap.create;

WITH RESULT DO

Begin

Width: = p.width;

Height: = p.height;

Canvas.DRAW (0, 0, p.graphic);

END;

IF assigned (result) THEN

Begin

JPG: = tjpegimage.create;

Jpg.Assign (Result);

Jpg.compressionquality: = QUALITY

Jpg.jpegneed;

Jpg.com;

IF assigned (jpg) THEN

Begin

Jpg.dibneed;

Result.Assign (JPG);

END;

END;

END;

转载请注明原文地址:https://www.9cbs.com/read-22571.html

New Post(0)