How to scale an image? | How to scale an image? |


How to scale an image?


I'm loading an image (a .png) and displaying it in a button the extent for the button size is smaller than the size of the image.


How do I shrink the image to fit inside button extent size? I tried using IWidget_SetScaledWidth()/Height() but it made no difference.


I know there is a scale widget, but the documentation for that says "Certain widgets support scaling e.g. one can apply scale to Image within ImageWidget. ScaleWidget takes this one step further ....".

So according to that it should be unnecessary to use a scale widget to scale an image. How do I do so?


The image is wrapped in the button as follows:


	nErr = ISHELL_CreateInstance(pIShell, AEECLSID_ButtonWidget, (void **)&piwButton);
	if(AEE_SUCCESS == nErr)
		nErr = ISHELL_CreateInstance(pIShell, AEECLSID_ImageWidget, (void **)&piwBgImage);
	if(AEE_SUCCESS == nErr) {
		//wrap button with image or (todo)text
		IDecorator_SetWidget((IDecorator *)(void*)piwButton, piwBgImage);