Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to shrink a jpeg image?

Posted on 2002-03-07
4
Medium Priority
?
321 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 200 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.
Suggested Courses

963 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