Solved

Doubling BitMap(s)

Posted on 1997-06-12
1
198 Views
Last Modified: 2010-04-06

   Suppose you have bitmap:

var
 Bmp1: TBitMap;
begin
 Bmp1 := TBitMap.Create;
 Bmp1.LoadFromFile(...);
...
...
end;


   How to make second BitMap that will be made off four Bmp1.
  (tiled, so that BMP2.width is equal to 2*Bmp1.width, and
   BMP2.Height is equal to 2Bmp1.Height)
0
Comment
Question by:bor061297
[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
1 Comment
 
LVL 4

Accepted Solution

by:
erajoj earned 100 total points
ID: 1336986
This should work:

var
  Bmp1, Bmp2: TBitMap;
  x, y      : Integer;
begin
  Bmp1 := TBitMap.Create;
  Bmp2 := TBitMap.Create;
  Bmp1.LoadFromFile(...);
  Bmp2.Width  := Bmp1.Width*2;
  Bmp2.Height := Bmp1.Height*2;
  for x := 0 to 1 do for y := 0 to 1 do begin // tiling
    Bmp2.Canvas.Draw(x*Bmp1.Width, y*Bmp1.Height, Bmp1);
  end;
  Bmp1.Free; // If you don't need it anymore.
end;

Hope this is what you needed!

/// John

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 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