Solved

Doubling BitMap(s)

Posted on 1997-06-12
1
187 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TVirtualStringTree  search using TEdit 7 121
Delphi XE2 application frozen on Windows 10 10 312
Dev express lookupcombo 3 28
DBCtrlGrid, Delphi, Scroll 7 14
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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