Solved

resizing image

Posted on 2001-06-03
3
204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
edey earned 35 total points
ID: 6151335
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
ID: 6154785
yes.
method 3) is what i needed. thanks for your help Mike.
0
 
LVL 6

Expert Comment

by:edey
ID: 6154948
Excellent, Glad to be of service :)

GL
Mike
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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