Page 1 of 1

IMAGE Control does NOT display .PNG resource

Posted: Sat Oct 26, 2019 5:04 pm
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 

 

Re: IMAGE Control does NOT display .PNG resource

Posted: Sat Oct 26, 2019 6:16 pm
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

Re: IMAGE Control does NOT display .PNG resource

Posted: Sat Oct 26, 2019 6:26 pm
by shri_fwh
Hi Uwe ,

Tried the same but its NOT working ...!

Re: IMAGE Control does NOT display .PNG resource

Posted: Sat Oct 26, 2019 7:15 pm
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

Re: IMAGE Control does NOT display .PNG resource

Posted: Sat Oct 26, 2019 11:37 pm
by nageswaragunupudi
IMAGE control requires freeimage.dll.

Use XIMAGE instead of IMAGE.

Re: IMAGE Control does NOT display .PNG resource

Posted: Sun Oct 27, 2019 11:07 am
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

Re: IMAGE Control does NOT display .PNG resource

Posted: Tue Oct 29, 2019 6:16 am
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

 

Re: IMAGE Control does NOT display .PNG resource

Posted: Tue Oct 29, 2019 8:45 am
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

Re: IMAGE Control does NOT display .PNG resource

Posted: Tue Oct 29, 2019 3:37 pm
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.

Re: IMAGE Control does NOT display .PNG resource

Posted: Tue Oct 29, 2019 5:34 pm
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

Re: IMAGE Control does NOT display .PNG resource

Posted: Wed Oct 30, 2019 11:40 am
by shri_fwh
Dear Rao Sir ,

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