Solved

how to shrink a jpeg image?

Posted on 2002-03-07
4
317 Views
Last Modified: 2013-11-19
i have a big area jepg image , i want it shrink into
smaller, how to realize it in program ?

for example , a 200 * 200 jpeg image shrink into a
100 * 100 jpeg image
0
Comment
Question by:escaper
  • 2
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6847201
convert it to a bitmap,
shrink the bitmap (maybe with bitblt)
convert back to jpeg
0
 
LVL 6

Accepted Solution

by:
DrDelphi earned 50 total points
ID: 6848414
var bmp:Tbitmap;
    jpg:TJpegImage;
begin
   jpg:=TJpegimage.create;
   Bmp:=Tbitmap.create;
   with bmp do
   begin
     height:=100;
     width:=100;
   end;
   Jpg.loadFromfile('z:\parsonsd\maya.jpg');
   bmp.Canvas.StretchDraw(Bmp.canvas.ClipRect,jpg);
   jpg.assign(bmp);
   jpg.SaveToFile('z:\new.jpg');
   freeandNil(jpg);
   FreeAndNil(bmp);
end;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6848433
yep, thats it
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6848460
<g>

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Learn how to use the remote presentation tool in Prezi to allow you to harness the power of this cloud based presentation platform. You can show your presentation with a remote audience using this free tool.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question