Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Doubling BitMap(s)

Posted on 1997-06-12
1
Medium Priority
?
207 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 400 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

972 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