Solved

Doubling BitMap(s)

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month6 days, 19 hours left to enroll

622 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