Solved

resizing a bmp

Posted on 2000-05-11
3
436 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
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

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

22 Experts available now in Live!

Get 1:1 Help Now