PNG images

PNG images

Postby Rimantas » Wed Oct 26, 2011 7:31 pm

Hi,

can I use png in toolbars , btnbmps ? If yes , how ? Through TImage class ? Or I must convert png to bmps ?

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: PNG images

Postby ukoenig » Wed Oct 26, 2011 10:33 pm

Hello Rimantas,

maybe have a look at :

viewtopic.php?f=3&t=18833&p=98781&hilit=png+btnbmp#p98781

Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: PNG images

Postby hua » Thu Oct 27, 2011 2:25 am

On another note, what are the image files that FWH can read directly without having to do any conversion? Only gif, bmp and png? Is jpg already supported?
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1050
Joined: Fri Oct 28, 2005 2:27 am

Re: PNG images

Postby Rimantas » Thu Oct 27, 2011 5:18 am




Thanks Uwe ! I didn't found this . This discused on May of 2011 . Maybe alreday it implemented in Fwh as standard ?
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: PNG images

Postby Rimantas » Tue Nov 01, 2011 8:34 am

Loading of PNG files now is OK . It leaves one problem . I want to did Toolbar and images I'm loading from png . Here is a sample :

Code: Select all  Expand view

   ...
   DEFINE IMAGELIST oImageList SIZE 28, 28
   oImageList:Add( TBitmap():Define( , cKelias_bmp + "copy.png", oWndPagr ), ;
   TBitmap():Define( , cKelias_bmp + "disabled\copy.png", oWndPagr ) )
   oImageList:Add( TBitmap():Define( , cKelias_bmp + "cut.png", oWndPagr ), ;
   TBitmap():Define( , cKelias_bmp + "disabled\cut.png", oWndPagr ) )
   ...
 


I'm overriding Bitmaps define and ImageList add methods adding for png support . All is working OK .

The main problem that Toolbar button must have masked image - something like black image in white background . It's needfull ? I added png disabled for masked , but the black background didn't dissapears ... How it can be solved ?

Picture of the problem ...
https://picasaweb.google.com/1101664083 ... 7919495890

Many thanks in advance !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: PNG images

Postby Rick Lipkin » Tue Nov 01, 2011 12:29 pm

Rimantas

Consider this code .. note you can use FILENAME or RESOURCE to call your icons... Your disabled icon ( second icon parameter ) needs to be a different image of the first .. only desaturated in greyscale as in the pictures below.

Rick

Code: Select all  Expand view


/*  use this code if you call by FILENAME  
DEFINE BUTTON oButt1 OF oBar FILENAME ( cDEFA+"\ICONS\BUILDING.BMP" ), ;
                                      ( cDEFA+"\ICONS\DBUILDING.BMP" ) ,( cDEFA+"\ICONS\DBUILDING.BMP" ) ;
MESSAGE "Property Information" ;
ACTION _PropBrow( oWnd,oBar )  ;
PROMPT "Property"
oButt1:cToolTip := { " " + CRLF + "Property Info", "Property Info", 1, CLR_BLACK, 14089979  }
*/


// use this code if you have imported your icons to .dll or compiled into your .exe
DEFINE BUTTON oButt1 OF oBar RESOURCE "BUILDING" , ;
                                      "DBUILDING", "DBUILDING"  ;
MESSAGE "Property Information" ;
ACTION _PropBrow( oWnd,oBar )  ;
PROMPT "Property"
oButt1:cToolTip := { " " + CRLF + "Property Info", "Property Info", 1, CLR_BLACK, 14089979  }
 


Image
User avatar
Rick Lipkin
 
Posts: 2634
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: PNG images

Postby Rimantas » Tue Nov 01, 2011 2:14 pm

Rick Lipkin wrote:Rimantas

Consider this code .. note you can use FILENAME or RESOURCE to call your icons... Your disabled icon ( second icon parameter ) needs to be a different image of the first .. only desaturated in greyscale as in the pictures below.

Rick
Code: Select all  Expand view

/*  use this code if you call by FILENAME  
DEFINE BUTTON oButt1 OF oBar FILENAME ( cDEFA+"\ICONS\BUILDING.BMP" ), ;
                                      ( cDEFA+"\ICONS\DBUILDING.BMP" ) ,( cDEFA+"\ICONS\DBUILDING.BMP" ) ;
MESSAGE "Property Information" ;
ACTION _PropBrow( oWnd,oBar )  ;
PROMPT "Property"
oButt1:cToolTip := { " " + CRLF + "Property Info", "Property Info", 1, CLR_BLACK, 14089979  }
*/


// use this code if you have imported your icons to .dll or compiled into your .exe
DEFINE BUTTON oButt1 OF oBar RESOURCE "BUILDING" , ;
                                      "DBUILDING", "DBUILDING"  ;
MESSAGE "Property Information" ;
ACTION _PropBrow( oWnd,oBar )  ;
PROMPT "Property"
oButt1:cToolTip := { " " + CRLF + "Property Info", "Property Info", 1, CLR_BLACK, 14089979  }
 




Rick,
I solved this problem - simply did bitmaps backgrounds in grayscale . Now it's OK .

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Antonio Linares, Google [Bot] and 30 guests