Solved

resizing a bmp

Posted on 2000-05-11
3
435 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
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
Comment Utility
hi zwarte,

use two bitmaps,
and the canvas-method stretchdraw

meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

7 Experts available now in Live!

Get 1:1 Help Now