SET_BCX_BITMAP statement
Purpose: SET_BCX_BITMAP complements the BCX_BITMAP function by allowing the bitmap image of a BCX_BITMAP control to be changed after the control has been created.
Syntax: SET_BCX_BITMAP(hBitmapDest, _ BitmapFile$ _ [, Res%] _ [, Width%] _ [, Height%]) Parameters:
|
Remarks: The SET_BCX_BITMAP statement has been written so that either a file based bitmap or a resource based bitmap can be passed to the procedure. The default setting for the optional parameter Res% is 0 which means that the bitmap will be retrieved from the file specified in BitmapFile$. If the bitmap is to be retrieved from a resource then the integer value of the resource handle is passed in Res% and 0 is used as a parameter value for BitmapFile$. The sample below illustrates this inside the EVENTS loop.
$RESOURCE"$PELLES$\bin\porc.exe"$COMPILER"$PELLES$\Bin\pocc -W1 -Gd -Go -Ze -Zx -Tx86-coff $FILE$.c"$LINKER"$PELLES$\Bin\polink _ -release _ -machine:ix86 _ -subsystem:windows _ -OUT:$FILE$.exe _ $FILE$.obj "BCX_RESOURCE123BITMAP two.bmpGUI"BCX_Set_Bitmap"GLOBALForm1ASCONTROLGLOBALBmp1ASCONTROLGLOBALButt1ASCONTROLSUBFORMLOAD Form1=BCX_FORM("Set_Bitmap",0,0,100,130)Bmp1=BCX_BITMAP("one.bmp", Form1,0,10,30,0,0)Butt1=BCX_BUTTON("Change", Form1,12345,15,10,0,0)CENTER(Form1)SHOW(Form1)ENDSUBBEGINEVENTSSTATIC ToggleIFCBCTL=12345THENToggle=NOTToggleSELECTCASEToggleCASETRUESET_BCX_BITMAP(Bmp1,0,123)' Load A Resource Based BitmapCASEFALSESET_BCX_BITMAP(Bmp1,"one.bmp")' Load A File Based BitmapENDSELECTENDIFENDEVENTS