Platforms to show: All Mac Windows Linux Cross-Platform

Back to Window class.

Window.SetWindowIconMBS(Type as Integer, File as FolderItem, IconID as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 7.4 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the window icon using the icon in the file.
Example
call window1.SetWindowIconMBS(0,getfolderitem("icon.ico"),1)

Returns true on success and false on failure.
What image depths are used and supported depends on the Windows version.

Type is 0 for a small icon and 1 for a big icon.

See also:

Some examples using this method:

Window.SetWindowIconMBS(Type as Integer, Icon as Picture, Mask as Picture) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 7.4 ❌ No ✅ Yes ❌ No ❌ No Desktop only
Sets the window icon using the given picture with mask.
Example
dim p as Picture
dim m as Picture

// random colored circle image
p=New Picture(16,16,32)
p.Graphics.ForeColor=&c000000
p.Graphics.FillRect 0,0,16,16
p.Graphics.ForeColor=rgb(rnd*256,rnd*256,rnd*256)
p.Graphics.Filloval 0,0,16,16

// circle mask
m=New Picture(16,16,32)
m.Graphics.ForeColor=&cFFFFFF // transparent
m.Graphics.Fillrect 0,0,16,16
m.Graphics.ForeColor=&c000000 // color
m.Graphics.Filloval 0,0,16,16

Canvas1.Backdrop=p // show in canvas
Canvas2.Backdrop=m

call window1.SetWindowIconMBS(0,p,m)

The mask picture ist converted to black/white.
What image depths are used and supported depends on the Windows version.
Returns true on success and false on failure.

Possible values for type:
ICON_BIG = 1Set the large icon for the window.
ICON_SMALL = 0Set the small icon for the window.

See also:

Some examples using this method:

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...