matlab.system.display.Icon - Specify custom image as icon for MATLAB System block - MATLAB (original) (raw)
Main Content
Namespace: matlab.system.display
Specify custom image as icon for MATLAB System block
Description
Use the matlab.system.display.Icon
class inside the getIconImpl method to specify a custom image to use as the icon for aMATLAB System block.
Creation
Description
icon = matlab.system.display.Icon([img](#mw%5F8cfa2eab-3462-4c6a-af77-8062dfaefe06))
specifies the icon for a MATLAB System block as the imageimg
.
Input Arguments
Image for block icon, specified as a string or a character vector that defines the name of the file that contains the image. When the image file is not on the path, specify the full path to the file.
The image file must use a format supported for block masks. Images in.cur
, .hdf4
,.ioc
, .pcx
,.ras
, .xwd
and.svg
cannot be used as block mask images.
Example: "image.png"
Examples
Define an image to use as the icon for a MATLAB System block in the class definition file.
methods(Access = protected)
function icon = getIconImpl(~)
icon = matlab.system.display.Icon("my_icon.png");
end
end
The specified image is now used as the icon for the MATLAB System block.
Version History
Introduced in R2017a