image on button resize

This forum is for eXpress++ general support.
Post Reply
Message
Author
ampandya
Posts: 58
Joined: Tue Apr 19, 2016 4:48 am

image on button resize

#1 Post by ampandya »

Hi,

Is there any way to resize the image on the button to resize with the button size?

for example if the button width and height is changed the image adjust to the button size!

Thanks

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: image on button resize

#2 Post by rdonnay »

Here is a small sample program that shows how to do this with DCPUSHBUTTONXP.
In the sample, SCALE 3.0 will increase the size of the original bitmap by 3X.

I found a problem with the class in which resizing was not working correctly, so you need to make a small change to _DCXBUTT.PRG first.

At line 1629, comment out the following code as shown :

/*
IF ::mouseMode > 0
RETURN nil
ENDIF
*/

Then rebuild DCLIPX.DLL by running BUILD20.bat or BUILD19_SL1.bat.

Here is the sample program:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL GetList[0], GetOptions

@ 0,0 DCPUSHBUTTONXP ;
      SIZE 100, 100 PIXEL ;
      BITMAP '\exp20\bitmaps\Bugicon.bmp' ;
      SCALE 3.0 ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

DCGETOPTIONS RESIZE

DCREAD GUI FIT OPTIONS GetOptions

RETURN nil

PROC appsys ; return
The eXpress train is coming - and it has more cars.

Post Reply