Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

resizing a bmp

Posted on 2000-05-11
3
Medium Priority
?
442 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 400 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

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…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline
Suggested Courses

926 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