BCX_ICON function
Purpose: BCX_ICON loads an icon from a file or resource and displays the image on a static control on the Parent window.
Syntax: hCtl = BCX_ICON(BitmapFile$, _ Parent_hWnd, _ id%, _ Xpos%, _ Y% _ [ ,Width%] _ [ ,Height%] _ [ ,Res%] _ [ ,WinStyle%] _ [, ExWinStyle%]) Parameters:
|
Result: If the control was created, the return value is the handle to the new control. If the function fails, the return value is NULL.
Remarks: The default window Style for a BCX_ICON control also can be changed by using the MODSTYLE function.
The syntax for animated cursors in the .rc file should be written as:
1234 ANICURSOR "FileName.ani"
Example: Windows XP only! Windows 98 will not load an animated icon as a resource.
Here is an example program showing how to load, as a resource,
an animated icon.
This example uses the Compass.ani file from the BCX\Gui_Demo\Ani-Icon folder.
Note well that the resource type must be ANICURSOR
.
GUI "AnimIcon" $RESOURCE "$PELLES$\bin\porc.exe" BCX_RESOURCE 1234 ANICURSOR "Compass.ani" $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 " DIM Form1 AS CONTROL DIM Icons[25] AS CONTROL SUB FORMLOAD LOCAL x,y,i Form1 = BCX_FORM("Animated Icons!", 0, 0, 150, 150) FOR x = 0 TO 4 FOR y = 0 TO 4 Icons[i] = BCX_ICON("", _ Form1, _ 100, _ x * 30, _ y * 30, _ 0, _ 0, _ 1234) INCR i NEXT NEXT CENTER(Form1) SHOW (Form1) END SUB BEGIN EVENTS END EVENTS