Solved

resizing image

Posted on 2001-06-03
3
200 Views
Last Modified: 2010-04-06
there is a part in my program for loading pictures(bmp and jpeg). Sometimes pictures are with resolution of 100DPI and they are just ok for showing in my program. But sometimes they are with diferent resolutions. For example 75DPI or even 300DPI. i want to resize them and to show them in my program as they are with 100DPI (program's default resolution). Does anyone knows how can i do that?

thanks in advance.
0
Comment
Question by:zastava101
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
edey earned 35 total points
Comment Utility
Well I can sugest three way.

1)draw them using canvas.stretchDraw instead of canvas.draw. This prob. won't look so good if you're reducing iages with text/lines in them

2)Write your own strechDraw routine.  This is a fair bit of work and should prob. be used only as a last resort

3)Use the TJPEG object. Assign your bit map to a jpeg, resize then assign back again.  This method is also usefull for converting images to greyscale.  It may seem like overkill, but there's a lot of good gfx code wrapped up in the jpeg spec/implementation

GL
Mike
0
 

Author Comment

by:zastava101
Comment Utility
yes.
method 3) is what i needed. thanks for your help Mike.
0
 
LVL 6

Expert Comment

by:edey
Comment Utility
Excellent, Glad to be of service :)

GL
Mike
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 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

8 Experts available now in Live!

Get 1:1 Help Now