Solved

resizing a bmp

Posted on 2000-05-11
3
439 Views
Last Modified: 2010-07-27
I have a bmp lets say 800X600 Dpi and I want to have one of 200X150, now I've tried creating a new bmp of 200X150 and then using copyrect to copy the 800X600 onto it (the way around doesn't give a lot of problems), but apparently when I reduce size, it has to much color to fill up the image and my image looks more like a bad 256 color drawing then a 16k drawing. So my question is : how do I resize my bmp so that my colors stay in tact?

Tnx,

Tom,
0
Comment
Question by:zwarte
[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 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 2799243
hi zwarte,

use two bitmaps,
and the canvas-method stretchdraw

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2799264
hi again,

a sample

procedure TForm1.Button1Click(Sender: TObject);
var b_source,b_dest : TBitmap;
begin
  b_source := TBitmap.Create;
  b_dest := TBitmap.Create;
  try
    b_source.LoadFromFile('Test.bmp');
    b_dest.Width := 200;
    b_dest.Height := 150;
    b_dest.Canvas.StretchDraw(Rect(0,0,200,150),b_source);
    b_dest.SaveToFile('testx.bmp');
  finally
    b_source.free;
    b_dest.Free;
  end;
end;

meikl
0
 
LVL 1

Author Comment

by:zwarte
ID: 2799274
I am feeling just a little bit stupid ;-)

but hey, when you need an answer fast, this still is the best way to get it (that and the delphi help of course ;-)

Tnx

Tom,
0

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
TEMBEDDEDWB how can i change its user agent ? 8 106
Graphics32 under Delphi 10.1 Berlin 2 187
Browsing a TTreeView in Delphi 5 49
Using MMsystem To change audio input 1 40
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 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