We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Doubling BitMap(s)

on
Medium Priority
219 Views

Suppose you have bitmap:

var
Bmp1: TBitMap;
begin
Bmp1 := TBitMap.Create;
...
...
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)
Comment
Watch Question

View Solution Only

Commented:
This should work:

var
Bmp1, Bmp2: TBitMap;
x, y      : Integer;
begin
Bmp1 := TBitMap.Create;
Bmp2 := TBitMap.Create;
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

Not the solution you were looking for? Getting a personalized solution is easy.

Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile