WireLess Studio Widgets Developer's Guide |
This method changes the image displayed on a WS_BITMAP widget.
VARIANT_BOOL SetImageFileByName(LPCTSTR sObjectName, LPCTSTR sFileName);
VARIANT_BOOL SetImageFileById(SHORT usObjectId, LPCTSTR sFileName);
On success, SetImageFile returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The supported formats are BMP, JPEG and PNG.
using WirelessStudioOleWidgets; WStWidget oWidget = new WStWidget(); RFFile oRfFile = new RFFile(); WStFactory oFactory = new WStFactory(); short iBitmapId = 22; oFactory .CreateWidgetById((short)WSTFactoryConstants.WS_BITMAP, iBitmapId, "", 0,0, 50, 50, ""); /* If the bmp is not found, it must be downloaded */ if (oRfFile.RFListFiles("stockUtilLogo.bmp") == 0) { oRfFile.RFTransferFile(@"../SamplesWidgets\Exe\Resources\Car.bmp", @"\Test\Resources\car.bmp", true); } oWidget.SetImageFileById(iBitmapId , @"\Test\Resources\car.bmp");
Public wsWidget As New WStWidget ... Select Case wsForm.GetLastEventSourceName() 'If any function key is pressed or the exit button is pressed 'the loop is ended Case "exitButton" bEnd = True Case "WSFunctionKeysController" bEnd = True Case "Image1Btn" wsWidget.SetImageFileByName "Image", "information.bmp" Case "Image2Btn" wsWidget.SetImageFileByName "Image", "shield.bmp" Case "Image3Btn" wsWidget.SetImageFileByName "Image", "warning.bmp" End Select ...
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |