IMAGE Control does NOT display .PNG resource

Post Reply
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

IMAGE Control does NOT display .PNG resource

Post by shri_fwh »

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


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

 
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: IMAGE Control does NOT display .PNG resource

Post by ukoenig »

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.
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Post by shri_fwh »

Hi Uwe ,

Tried the same but its NOT working ...!
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: IMAGE Control does NOT display .PNG resource

Post by ukoenig »

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
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: IMAGE Control does NOT display .PNG resource

Post by nageswaragunupudi »

IMAGE control requires freeimage.dll.

Use XIMAGE instead of IMAGE.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: IMAGE Control does NOT display .PNG resource

Post by ukoenig »

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.
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Post by shri_fwh »

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


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

Re: IMAGE Control does NOT display .PNG resource

Post by ukoenig »

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.
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Post by shri_fwh »

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

STYLE nOR( DS_MODALFRAME, WS_POPUP )
then it is NOT working.
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: IMAGE Control does NOT display .PNG resource

Post by nageswaragunupudi »

Please try this way:

Code: Select all

#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

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
shri_fwh
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: IMAGE Control does NOT display .PNG resource

Post by shri_fwh »

Dear Rao Sir ,

Thanks a lot ...! Its working ...!
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
Post Reply