List Info

Thread: Re: Save a modified jpeg




Re: Save a modified jpeg
country flaguser name
United Kingdom
1969-12-31 18:00:00

Hi Alin

Here is some code that works.

Bobby

uses
JPeg

var
JPG : TJPegImage;
BMP : TBitMap;
begin
BMP := TBitMap.Create;
try
BMP.PixelFormat := pf24bit;

<set up BMP>

SaveDialog1.DefaultExt := '.jpg';
if SaveDialog1.Execute then
begin
if lowercase(ExtractFileExt(SaveDialog1.FileName)) = '.bmp'
then BMP.SaveToFile(SaveDialog1.FileName)
else if lowercase(ExtractFileExt(SaveDialog1.FileName)) =
'.jpg' then
begin
JPG := TJPegImage.Create;
try
JPG.Assign(BMP);
JPG.SaveToFile(SaveDialog1.FileName);
finally
JPG.Free;
end;
end;
finally
BMP.Free;
end;
end;

Alin wrote:
&gt;
> HI guys, im kinda new to this group and i searched the message
> database but could not find an answer to my prob. im trying to send
>; jpeg images thru a small client server application. the thing is when
>; i save the modified jpeg (ex. grayscale, half size etc.) it saves the
> internal bmp, with the *.jpg but full colors and resolution. if some
>; one could give some hints.
&gt; im using BDS delphi but on Win32. thanks
&gt;
>
> ----------------------------------------------------------
>
&gt; Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.18/734 - Release Date: 26/03/2007 14:31
&gt;

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )