Page 1 of 1

PNG on buttons

Posted: Wed Dec 11, 2013 4:33 am
by skiman
Hi,

Is there a way to use PNG images on buttons instead of BMP files? With the use of the transparancy?

Re: PNG on buttons

Posted: Wed Dec 11, 2013 9:41 am
by rdonnay

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], oBitmap

oBitmap := DC_GetBitmap('MokoSanta.Png')
oBitmap:transparentClr := GRA_CLR_WHITE

@ 0,0 DCPUSHBUTTONXP CAPTION oBitmap SIZE 500,500 PIXEL ;
      COLOR GRA_CLR_DARKPINK GRADIENT .3

DCREAD GUI FIT TITLE 'Transparent Button'

RETURN nil

* -------

PROC appsys ; return
MokoSanta.png
MokoSanta.png (344.58 KiB) Viewed 5183 times

Re: PNG on buttons

Posted: Wed Dec 11, 2013 1:03 pm
by skiman
Hi Roger,

Thanks for the sample.

Would it be possible to add the PNG to a DLL and to use it that way?

Otherwise I'm thinking about creating a font with my icons.