Recent

Author Topic: BGRABitmap and GLScene TEXTURE  (Read 5528 times)

hgabor47

  • Newbie
  • Posts: 6
BGRABitmap and GLScene TEXTURE
« on: October 03, 2011, 11:52:26 am »
I want to make mix the GLTexture with BGRABitmap but I don't assign to...
Code: [Select]
 
  c:=BGRABlack;
  c.alpha:=0;
  pic:=TBGRABitmap.Create(round(self.Fcontentsize[0]),round(self.Fcontentsize[1]),c);
  pic.FontName:='Arial';
  pic.FontAntialias:=true;
  pic.FontHeight:=20;
  ftext:='TEXT';
  pic.TextOut(4,10,ftext,BGRAWhite);

  with self.Material do
  begin
    texture.Enabled:=true;
    Texture.Image.assign(  pic )  //This wrong certeanly...

I tried some way, but not working...
Please help me

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: BGRABitmap and GLScene TEXTURE
« Reply #1 on: October 03, 2011, 12:23:30 pm »
Maybe pic.Bitmap
Conscience is the debugger of the mind

hgabor47

  • Newbie
  • Posts: 6
Re: BGRABitmap and GLScene TEXTURE
« Reply #2 on: October 03, 2011, 07:55:26 pm »
Maybe pic.Bitmap
Thx, but this is not working!
Any idea?

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: BGRABitmap and GLScene TEXTURE
« Reply #3 on: October 03, 2011, 07:58:29 pm »
What is the parameter expected by Texture.Image.Assign ?

What is the type of Texture ?
Conscience is the debugger of the mind

hgabor47

  • Newbie
  • Posts: 6
Re: BGRABitmap and GLScene TEXTURE
« Reply #4 on: October 03, 2011, 08:08:12 pm »
What is the parameter expected by Texture.Image.Assign ?
procedure Assign(Source: TPersistent);

What is the type of Texture ?
...
 property Texture: TGLTexture read GetTexture write SetTexture ....
...
TGLTexture = class(TGLUpdateAbleObject)...




hgabor47

  • Newbie
  • Posts: 6
Re: BGRABitmap and GLScene TEXTURE
« Reply #5 on: October 03, 2011, 08:18:06 pm »
But this is working with normal bitmap...
Code: [Select]
  b := Tpicture.create;
  With b.bitmap do
  begin
...
  end;
...
  with self.Material do
  begin
    Texture.Assign(b.Graphic);

hgabor47

  • Newbie
  • Posts: 6
Re: BGRABitmap and GLScene TEXTURE
« Reply #6 on: October 03, 2011, 08:41:56 pm »
Oooops.
Thanks...
This is the solution:
Code: [Select]
  with self.Material do
  begin
    g:=tPicture.Create;
    g.Assign(pic);
    texture.Assign(g);           
    g.Destroy;

circular

  • Hero Member
  • *****
  • Posts: 4196
    • Personal webpage
Re: BGRABitmap and GLScene TEXTURE
« Reply #7 on: October 03, 2011, 08:44:06 pm »
What about
Code: [Select]
Texture.Assign(pic.Bitmap)
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018