Solved

how to shrink a jpeg image?

Posted on 2002-03-07
4
312 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now