Solved

how to shrink a jpeg image?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.
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…

815 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

13 Experts available now in Live!

Get 1:1 Help Now