Solved

Doubling BitMap(s)

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

12 Experts available now in Live!

Get 1:1 Help Now