FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PNG images
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
PNG images
Posted: Wed Oct 26, 2011 07: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.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: PNG images
Posted: Wed Oct 26, 2011 10:33 PM

Hello Rimantas,

maybe have a look at :

viewtopic.php?f=3t=18833p=98781hilit=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.
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: PNG images
Posted: Thu Oct 27, 2011 02: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
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: PNG images
Posted: Thu Oct 27, 2011 05:18 AM
ukoenig wrote:
maybe have a look at :
viewtopic.php?f=3&t=18833&p=98781&hilit=png+btnbmp#p98781



Thanks Uwe ! I didn't found this . This discused on May of 2011 . Maybe alreday it implemented in Fwh as standard ?
Rimantas U.
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: PNG images
Posted: Tue Nov 01, 2011 08: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 (fw): Select all Collapse
   ...
   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.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: PNG images
Posted: 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 (fw): Select all Collapse
/*  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  }


Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: PNG images
Posted: Tue Nov 01, 2011 02: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 (fw): Select all Collapse
/*  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.

Continue the discussion