Solved

resizing image

Posted on 2001-06-03
3
201 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

21 Experts available now in Live!

Get 1:1 Help Now