FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to make a TBTNBMP transparent
Posts: 10
Joined: Mon Mar 05, 2007 11:18 PM
How to make a TBTNBMP transparent
Posted: Tue Apr 10, 2007 01:01 AM

Hi,

I am dynamically creating a BTNBMP (not from resource) to a window and I can't make it transparent. However, if I do it from a Resource dialog, it works. How can I do it without using a Resource dialog?

This one works for a Resource dialog:
REDEFINE BTNBMP oBTN RESOURCE "TEST" OF oDLG NOBORDER
oBTN:LTRANSPARENT:=.T.

However this one doesn't : (displays bitmap but not transparent)
@100,100 BTNBMP oBTN RESOURCE "TEST" SIZE 280,110 OF oWND NOBORDER
oBTN:LTRANSPARENT:=.T.

Thanks
Bert

Posts: 10
Joined: Mon Mar 05, 2007 11:18 PM
More
Posted: Tue Apr 10, 2007 01:12 AM

I am using a BRUSH in my window thats why I want the BTNBMP to be trasparent.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to make a TBTNBMP transparent
Posted: Tue Apr 10, 2007 05:28 AM
Bert,

Here you have a working sample:
// Testing a transparent TBtnBmp on a transparent DialogBox

#include "FiveWin.ch"

function Main()

   local oBru, oDlg, oBtn

   DEFINE BRUSH oBru FILENAME "../bitmaps/Backgrnd/beach.bmp"

   DEFINE DIALOG oDlg SIZE 400, 200 BRUSH oBru TRANSPARENT

   @ 70, 80 BTNBMP oBtn FILENAME "../bitmaps/yes.bmp" ;
      SIZE 50, 30 OF oDlg NOBORDER ACTION MsgInfo( "click" )

   oBtn:lTransparent = .T.   

   ACTIVATE DIALOG oDlg CENTERED

return nil

Please notice the use of the clause TRANSPARENT when defining the dialog too
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10
Joined: Mon Mar 05, 2007 11:18 PM
How to make a TBTNBMP transparent
Posted: Tue Apr 10, 2007 01:04 PM

Thank you Antonio, it works when used in a Dialog, but how can you do it in a Window? There is no TRANSPARENT clause when defining a Window.

Thanks again,
Bert

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
How to make a TBTNBMP transparent
Posted: Thu Apr 12, 2007 06:11 AM

Bert,

Currently is supported for dialogboxes only

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion