FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour IMAGE Control does NOT display .PNG resource
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
IMAGE Control does NOT display .PNG resource
Posted: Sat Oct 26, 2019 05:04 PM
Dear All ,

The below command of IMAGE is NOT working. The Image from the resource of .PNG file , the same resource is working with BTNBMP control. It is showing on the Button properly.
But it is NOT displaying when using with IMAGE control. Could you please let me know where It is mistake ?

Code (fw): Select all Collapse
@ 10, 10 IMAGE oImg RESOURCE "save"  PIXEL OF oDlg  NOBORDER
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Sat Oct 26, 2019 06:16 PM
Maybe the missing size :-)

@ 10, 10 IMAGE oImg RESOURCE "save" PIXEL OF oDlg NOBORDER


@ 10, 10 IMAGE oImage SIZE 50, 50 RESOURCE "save" OF oDlg NOBORDER

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: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Sat Oct 26, 2019 06:26 PM
Hi Uwe ,

Tried the same but its NOT working ...!
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Sat Oct 26, 2019 07:15 PM

Size and pixel is not needed

I just tested a Bmp-resource without any problem
I will check PNG as well

@ 10, 10 IMAGE oImage RESOURCE "Exit" OF oWnd NOBORDER // Exit = bmp-resource

regards
Uwe :D

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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: IMAGE Control does NOT display .PNG resource
Posted: Sat Oct 26, 2019 11:37 PM

IMAGE control requires freeimage.dll.

Use XIMAGE instead of IMAGE.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Sun Oct 27, 2019 11:07 AM
IMAGE control requires freeimage.dll.
Use XIMAGE instead of IMAGE.


Download sample ( PNG from resource )
http://www.pflegeplus.com/DOWNLOADS/PNGRES.zip



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: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Tue Oct 29, 2019 06:16 AM
Hi Uwe , Rao Sir ,

I have tried with XIMAGE but its does NOT display WINDOW when the WINDOW STYLE is defined without WS_CAPTION, please see the below code for the same.


Code (fw): Select all Collapse
#include "FiveWin.ch"

FUNCTION MAIN()
local oDlg, oImage[3]

DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;  
STYLE nOR( DS_MODALFRAME, WS_POPUP )

//, WS_CAPTION, WS_SYSMENU, ;               WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )  

@ 30,   50 XIMAGE oImage[1] RESOURCE "Icon1" OF oDlg NOBORDER 
@ 30, 200 XIMAGE oImage[2] RESOURCE "Icon2" OF oDlg NOBORDER
@ 30, 350 XIMAGE oImage[3] RESOURCE "Icon3" OF oDlg NOBORDER

AEval( oImage, {|o, n| o:lTransparent := .T. } )

oDlg:SetColor( 0, 14663808 )

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Tue Oct 29, 2019 08:45 AM

Hello Shridhar,

for a normal dialog Style-define is not needed just

DEFINE DIALOG oDlg FROM 10, 10 TO 400, 600 PIXEL TRUEPIXEL
or
DEFINE DIALOG oDlg SIZE 600, 400 PIXEL TRUEPIXEL

regards
Uwe :D

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: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Tue Oct 29, 2019 03:37 PM
HI Uwe ,

Yes ...! This is works but in the application the DIALOG windows are defined without CAPTIONS ( excludes WS_CAPTION ) .

When the DIALOG Window is defined with
Code (fw): Select all Collapse
STYLE nOR( DS_MODALFRAME, WS_POPUP )
then it is NOT working.
Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: IMAGE Control does NOT display .PNG resource
Posted: Tue Oct 29, 2019 05:34 PM
Please try this way:
Code (fw): Select all Collapse
#include "FiveWin.ch"

FUNCTION MAIN()
local oDlg, oImage[3]

DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL ;
STYLE nOR( DS_MODALFRAME, WS_POPUP )

//, WS_CAPTION, WS_SYSMENU, ;               WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

oDlg:bInit := <||
   @ 30,   50 XIMAGE oImage[1] RESOURCE "Icon1" OF oDlg NOBORDER
   @ 30, 200 XIMAGE oImage[2] RESOURCE "Icon2" OF oDlg NOBORDER
   @ 30, 350 XIMAGE oImage[3] RESOURCE "Icon3" OF oDlg NOBORDER

   AEval( oImage, {|o, n| o:lTransparent := .T. } )
   return nil
>

oDlg:SetColor( 0, 14663808 )

ACTIVATE DIALOG oDlg CENTERED

RETURN NIL


rc file:
Code (fw): Select all Collapse
ICON1 10 "c:\fwh\bitmaps\pngs\image1.png"
ICON2 10 "c:\fwh\bitmaps\pngs\image7.png"
ICON3 10 "c:\fwh\bitmaps\pngs\image8.png"


Regards



G. N. Rao.

Hyderabad, India
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: IMAGE Control does NOT display .PNG resource
Posted: Wed Oct 30, 2019 11:40 AM

Dear Rao Sir ,

Thanks a lot ...! Its working ...!

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB

Continue the discussion