How to change JPG size with delphi and put it in DB?
I was trying with something like this:
////////////////////////
var
jpg: TJpegImage;
......
if openpicturedialog1.Execute then
begin
jpg:= TJpegImage.Create;
try
jpg.Loadfromfile( openpicturedialog1.filename );
if jpg.Height>jpg.Width then
begin
jpg.Height:=round(jpg.Height/20);
jpg.Width:=round(jpg.Width/20);
end;
EDBImage1.Picture.LoadFromFile(openpicturedialog1.FileName);
finally
jpg.Free;
end;
////////////////////////
but error accrue - cannot change size of JPEG image!
I was trying with something like this:
////////////////////////
var
jpg: TJpegImage;
......
if openpicturedialog1.Execute then
begin
jpg:= TJpegImage.Create;
try
jpg.Loadfromfile( openpicturedialog1.filename );
if jpg.Height>jpg.Width then
begin
jpg.Height:=round(jpg.Height/20);
jpg.Width:=round(jpg.Width/20);
end;
EDBImage1.Picture.LoadFromFile(openpicturedialog1.FileName);
finally
jpg.Free;
end;
////////////////////////
but error accrue - cannot change size of JPEG image!