How to make a TBTNBMP transparent

How to make a TBTNBMP transparent

Postby bterce@matrixcomputer.com » Tue Apr 10, 2007 1: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
bterce@matrixcomputer.com
 
Posts: 10
Joined: Mon Mar 05, 2007 11:18 pm
Location: Southern California

More

Postby bterce@matrixcomputer.com » Tue Apr 10, 2007 1:12 am

I am using a BRUSH in my window thats why I want the BTNBMP to be trasparent.
bterce@matrixcomputer.com
 
Posts: 10
Joined: Mon Mar 05, 2007 11:18 pm
Location: Southern California

Postby Antonio Linares » Tue Apr 10, 2007 5:28 am

Bert,

Here you have a working sample:
Code: Select all  Expand view
// 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
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby bterce@matrixcomputer.com » Tue Apr 10, 2007 1: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
bterce@matrixcomputer.com
 
Posts: 10
Joined: Mon Mar 05, 2007 11:18 pm
Location: Southern California

Postby Antonio Linares » Thu Apr 12, 2007 6:11 am

Bert,

Currently is supported for dialogboxes only
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests