InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PNGArt Class Reference
Inheritance diagram for PNGArt:
IArt

Public Member Functions

 ~PNGArt ()
 
bool SetRsrc (const PluginID &pid, const RsrcID &rid, const bool isRollOver, const bool isDark=false, const float scaleFactor=1.0, const float iconScale=2.0)
 
bool SetRsrc (const RsrcSpec &spec, const float scaleFactor=1.0, const float iconScale=2.0)
 
bool SetFile (const IDFile &idFile, const float scaleFactor=1.0, const float iconScale=2.0)
 
void Draw (IGraphicsPort *gPort, const PMMatrix &imMatrix, int32 agmflags)
 
void DrawDisabled (IGraphicsPort *gPort, const PMMatrix &imMatrix, int32 agmflags)
 
bool HasAlpha ()
 
bool IsLoaded ()
 
void Delete ()
 
int GetHeight () const
 
int GetWidth () const
 
AGMImageRecordGetBitmap () const
 

Static Public Member Functions

static void ReleasePNGSharedCaches (void)
 

Constructor & Destructor Documentation

PNGArt::~PNGArt ()

If a PNG resource has been loaded it deletes it.

Member Function Documentation

void PNGArt::Delete ()
virtual

Deletes the PNG resource, this is done automatically when this class is destroyed

Implements IArt.

void PNGArt::Draw (IGraphicsPortgPort,
const PMMatriximMatrix,
int32 agmflags 
)
virtual

Draw's the PNG to the supplied graphics port

Parameters
IGraphicsPort,:IGraphicsPort to draw to
PMMatrix,:Transformation matrix to apply to the PNG, if no translation is desired use the idenity matrix or just a plain PMMatrix.
agmflags,:Any desired AGM flags, use 0 if none are desired.

Implements IArt.

void PNGArt::DrawDisabled (IGraphicsPortgPort,
const PMMatriximMatrix,
int32 agmflags 
)
virtual

Draw's the PNG with a 50% transparensy see regular draw methode for more info.

Implements IArt.

AGMImageRecord* PNGArt::GetBitmap () const
virtual
Returns
A pointer to the AGMImageRecord for the loaded PNG resource

Implements IArt.

int PNGArt::GetHeight () const
virtual
Returns
The height of the loaded PNG resource

Implements IArt.

int PNGArt::GetWidth () const
virtual
Returns
The width of the loaded PNG resource

Implements IArt.

bool PNGArt::HasAlpha ()
virtual

Does the PNG have a a alpha?

Returns
true if PNG contains pixels not totally opaque

Implements IArt.

bool PNGArt::IsLoaded ()
virtual

Did the PNG sucessfully load?

Returns
true if loaded

Implements IArt.

static void PNGArt::ReleasePNGSharedCaches (void )
static

Different instantiations of PNGArt may share a cached PNG reader. ReleaseCaches can be called to free these caches.

bool PNGArt::SetFile (const IDFileidFile,
const float scaleFactor = 1.0,
const float iconScale = 2.0 
)
virtual

Deletes any currently loaded resource and loads a PNG image file resource in from the supplied file.

Parameters
pathto a PNG file
floatscale factor at which image should be displayed.
floatscale of the icon.
Returns
true if file / resource was loaded

Implements IArt.

bool PNGArt::SetRsrc (const PluginIDpid,
const RsrcID & rid,
const bool isRollOver,
const bool isDark = false,
const float scaleFactor = 1.0,
const float iconScale = 2.0 
)
virtual

Deletes any currently loaded resource and loads a PNG image from a plugin's resource. This is the preferred approach.

Parameters
PluginID,:PluginId to load the resource from
RsrcID,:Resource ID of the PNG
bool,:Rollover resource? If false, then a resource type of "PNGA" will be loaded, else a resource type of "PNGR" will be loaded.
bool,:Dark UI resource? If false, then a resource type of "PNGA" (or "PNGR" if isRollover is true) will be loaded, else a resource type of "PNGD" (or "PNGK" if isRollover is true) will be loaded. Default is false.
floatscale factor at which image should be displayed.
floatscale of the icon.
Returns
true if file / resource was loaded

Implements IArt.