Recent

Author Topic: Tile image as background  (Read 24714 times)

lainz

  • Guest
Re: Tile image as background
« Reply #15 on: September 29, 2011, 01:17:22 am »
BTW I've added a new property 'Tile' in BGRASpriteAnimation in the git repository of BGRAControls.

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Tile image as background
« Reply #16 on: September 29, 2011, 01:39:14 am »
That's right Lainz, you can use GetPart.

You can also use the Fill method. Instead of writing
Code: [Select]
var
  tile: TBGRABitmap;
begin
  tile := background.GetPart(rect(0,0,Width,Height)) as TBGRABitmap;
  Bitmap.PutImage(0,0,tile,dmSet);
  tile.Free;
end;

You can write
Code: [Select]
begin
  Bitmap.Fill(background);
end;
Conscience is the debugger of the mind

lainz

  • Guest
Re: Tile image as background
« Reply #17 on: November 13, 2011, 03:55:13 pm »
I can fill transparent bitmap?

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Tile image as background
« Reply #18 on: November 13, 2011, 05:02:51 pm »
Of course, with FillTransparent method.
Conscience is the debugger of the mind

lainz

  • Guest
Re: Tile image as background
« Reply #19 on: November 13, 2011, 05:12:20 pm »
My question is if I can fill a bitmap with transparent area with Bitmap1.Fill(Bitmap2); (bitmap2 has alpha pixels);

You can add procedure TBGRADefaultBitmap.Fill(texture: IBGRAScanner);   with a new option transparent: boolean, or drawmode: TDrawMode;

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Tile image as background
« Reply #20 on: November 13, 2011, 05:22:57 pm »
Ah ok, you mean when there are alpha pixels, they are blended and you would like to use dmSet mode instead ?
Conscience is the debugger of the mind

lainz

  • Guest
Re: Tile image as background
« Reply #21 on: November 13, 2011, 07:08:49 pm »
Ah ok, you mean when there are alpha pixels, they are blended and you would like to use dmSet mode instead ?

They aren't blended with Fill(bitmap) because by default is dmSet in:

Code: [Select]
procedure TBGRADefaultBitmap.Fill(texture: IBGRAScanner);
begin
  FillRect(FClipRect.Left,FClipRect.Top,FClipRect.Right,FClipRect.Bottom,texture,dmSet);
end;   

BTW I've solved the problem using FillRect.

Code: [Select]
battleroom.FillRect(0, 0, battleroom.Width, battleroom.Height, grid, dmDrawWithTransparency); 

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Tile image as background
« Reply #22 on: November 13, 2011, 11:16:46 pm »
Ok. I've added Fill(IBGRAScanner, TDrawMode) on subversion
Conscience is the debugger of the mind

lainz

  • Guest
Re: Tile image as background
« Reply #23 on: November 14, 2011, 01:53:46 am »
Thx

 

TinyPortal © 2005-2018