Hi,
can I use png in toolbars , btnbmps ? If yes , how ? Through TImage class ? Or I must convert png to bmps ?
With best regards !
PNG images
Re: PNG images
Hello Rimantas,
maybe have a look at :
viewtopic.php?f=3&t=18833&p=98781&hilit=png+btnbmp#p98781
Best Regards
Uwe
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: PNG images
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
BCC5.82/BCC7.3
xHarbour/Harbour
Re: PNG images
Thanks Uwe ! I didn't found this . This discused on May of 2011 . Maybe alreday it implemented in Fwh as standard ?
Rimantas U.
Re: PNG images
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 :
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 !
Code: Select all | Expand
...
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.
- Rick Lipkin
- Posts: 2668
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: PNG images
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

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
/* 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 }

Re: PNG images
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.
RickCode: Select all | Expand
/* 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.