Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

resizing a bmp

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 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