IMAGE Control does NOT display .PNG resource

IMAGE Control does NOT display .PNG resource

Postby shri_fwh » Sat Oct 26, 2019 5: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: Select all  Expand view


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

 
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Postby ukoenig » Sat Oct 26, 2019 6: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 :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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: IMAGE Control does NOT display .PNG resource

Postby shri_fwh » Sat Oct 26, 2019 6:26 pm

Hi Uwe ,

Tried the same but its NOT working ...!
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Postby ukoenig » Sat Oct 26, 2019 7: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: IMAGE Control does NOT display .PNG resource

Postby nageswaragunupudi » Sat Oct 26, 2019 11:37 pm

IMAGE control requires freeimage.dll.

Use XIMAGE instead of IMAGE.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: IMAGE Control does NOT display .PNG resource

Postby ukoenig » 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

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: IMAGE Control does NOT display .PNG resource

Postby shri_fwh » Tue Oct 29, 2019 6: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: Select all  Expand view


#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 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Postby ukoenig » Tue Oct 29, 2019 8: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: IMAGE Control does NOT display .PNG resource

Postby shri_fwh » Tue Oct 29, 2019 3: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: Select all  Expand view
STYLE nOR( DS_MODALFRAME, WS_POPUP )
then it is NOT working.
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Postby nageswaragunupudi » Tue Oct 29, 2019 5:34 pm

Please try this way:
Code: Select all  Expand view
#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: Select all  Expand view
ICON1 10 "c:\fwh\bitmaps\pngs\image1.png"
ICON2 10 "c:\fwh\bitmaps\pngs\image7.png"
ICON3 10 "c:\fwh\bitmaps\pngs\image8.png"
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10631
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: IMAGE Control does NOT display .PNG resource

Postby shri_fwh » Wed Oct 30, 2019 11:40 am

Dear Rao Sir ,

Thanks a lot ...! Its working ...!
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 34 guests