InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PNGIcon Class Reference

#include <PNGIcon.h>

Public Member Functions

void ReadWrite (IPMStream *s, ImplementationID prop)
 
void LoadIcon (const PluginID &pid, const RsrcID &iconRsrcID, bool brightnessAware=true, bool isAdornmentIcon=false)
 
void Draw (IViewPort *viewPort, const SysRect &bbox, bool drawDisabled)
 
ErrorCode DrawIcon (IGraphicsPort *graphicsPort)
 
SysRect GetBounds ()
 
RsrcID GetRsrcID ()
 
PluginID GetRsrcPluginID ()
 
bool IsLoaded ()
 

Static Public Member Functions

static PNGIconCreateIcon (const PMRsrcID &inRsrcID, bool brightnesssAware=true, bool isAdornmentIcon=false)
 

Protected Attributes

PluginID fPid
 
RsrcID fIconRsrcID
 

Detailed Description

This class encapsulates loading & drawing a PNG based icon. Supports hires and dark UI icons.

Member Function Documentation

static PNGIcon* PNGIcon::CreateIcon (const PMRsrcIDinRsrcID,
bool brightnesssAware = true,
bool isAdornmentIcon = false 
)
static

API from old PlatformIcon class

Parameters
inRsrcIDthe icon/PNG/SVG resource id within the plugin
brightnessAwareif true, the icon switches according to UI brightness at drawing time. Else bright UI icon is always drawn.
isAdornmentIconwhether the icon is an adornment. If true, InDesign will scale the SVG icon based on the UI Scaling preference.
void PNGIcon::Draw (IViewPortviewPort,
const SysRectbbox,
bool drawDisabled 
)

Draw the icon previously loaded into this object

Parameters
viewPortthe port to draw into
bboxthe rect to draw into
drawDisableda boolean indicating if the icon should be drawn with a disabled look
ErrorCode PNGIcon::DrawIcon (IGraphicsPortgraphicsPort)

Draw the icon previously loaded into this object

Parameters
graphicsPortthe graphics port to draw into
void PNGIcon::LoadIcon (const PluginIDpid,
const RsrcID & iconRsrcID,
bool brightnessAware = true,
bool isAdornmentIcon = false 
)

Load an icon into this object for later drawing.

Parameters
pidthe plugin the icon is coming from
iconRsrcIDthe icon/PNG/SVG resource id within the plugin
brightnessAwareif true, the icon switches according to UI brightness at drawing time. Else bright UI icon is always drawn.
isAdornmentIconwhether the icon is an adornment. If true, InDesign will scale the SVG icon based on the UI Scaling preference.
void PNGIcon::ReadWrite (IPMStreams,
ImplementationID prop 
)

Read or write this object to the given stream.

Parameters
sthe stream to read or write from/to
propignored