Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

IconFamilyMBS.Small8BitMask as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Icon Service MBS Picture Plugin 2.7 Yes No No Yes, macOS only No
Function: If such an icon is included in this icon family, this function returns it.
Example:
dim i as new IconMBS("FNDR", "MACS")

Backdrop = i.IconFamily.Small8BitMask
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

IconFamilyMBS.Thumbnail32BitData as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Icon Service MBS Picture Plugin 2.7 Yes No No Yes, macOS only No
Function: If such an icon is included in this icon family, this function returns it.
Example:
// Example about a function to return a REALbasic picture with an icon and its
// mask.
//
Function geticonpicture As picture
// You have to add more support, like for example for Huge and Small icons.

dim icon as IconMBS
dim p as picture
dim b as picture
dim m as picture

icon=new IconMBS("APPL","sbkt")

if icon.valid then
dim i as IconFamilyMBS = icon.IconFamily

p=newpicture(128,128,32)

b=i.Thumbnail32BitData
if b<>nil then
p.graphics.drawpicture b,0,0
p.mask.graphics.drawpicture i.thumbnail8BitMask,0,0
return p
end if

m=i.Large1BitMask
if m<>nil then
b=i.Large32BitData
if B=nil then
b=i.Large8BitData
end if
if b=nil then
b=i.Large4BitData
end if
if b=nil then
b=i.large1BitData
end if

p.graphics.drawpicture b,0,0,128,128,0,0,32,32
b=i.large8BitMask
if b<>nil then
m=b
end if
p.mask.graphics.drawpicture m,0,0,128,128,0,0,32,32
return p
end if

end if
End Function
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

IconFamilyMBS.Thumbnail8BitMask as picture
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
property Icon Service MBS Picture Plugin 2.7 Yes No No Yes, macOS only No
Function: If such an icon is included in this icon family, this function returns it.
Example:
dim i as new IconMBS("FNDR", "MACS")

Backdrop = i.IconFamily.Thumbnail8BitMask
Notes:
Lasterror is set.
(Read and Write computed property)

Feedback, Comments & Corrections

IconFamilyMBS.WriteFile(f as folderitem)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Icon Service MBS Picture Plugin 2.7 Yes No No Yes, macOS only No
Function: Writes the icon family into an icon file.
Example:
dim pict,mask as Picture
dim iconfamily as IconFamilyMBS
dim f as FolderItem

// create pictures
pict=NewPicture(128,128,32)
mask=NewPicture(128,128,32)

pict.Graphics.ForeColor=rgb(255,0,0)
pict.Graphics.FillOval 0,0,128,128

mask.Graphics.ForeColor=rgb(0,0,0)
mask.Graphics.FillOval 0,0,128,128

// make an icon family
iconfamily=NewIconFamilyMBS
iconfamily.Thumbnail32BitData=pict
iconfamily.Thumbnail8BitMask=mask
' you may fill more like iconfamily.Large32BitData...

f=SpecialFolder.Desktop.Child("test.icns")

// Save *.ICNS file:
iconfamily.WriteFile f

if f.AddCustomIconMBS(iconfamily,false)=0 then
// succesfully added custom icon
end if
Notes: LastError is set.

Feedback, Comments & Corrections

Previous items

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




Links
MBS Xojo Plugins