Unit 'icon' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#os4units]

GetIconRectangleA

Query the size of the area an icon renders into

Declaration

Source position: icon.pas line 252

function GetIconRectangleA(

  Rp: PRastPort;

  const Icon: PDiskObject;

  const Label_: PChar;

  Rect: PRectangle;

  const Tags: PTagItem

):LongBool;

Arguments

Rp

  

Pointer to the RastPort to use for calculating the the size of the label with respect to the font and style options currently in use; this parameter may be NULL if the label is NULL, too.

Icon

  

True if the parameters were well-formed and the output data fits into the Rectangle data structure (which may not be the case if the image is too large for a signed 16 bit integer to hold).

Label_

  

Label for icon, if nil no text is calculated

Rect

  

Pointer to a Rectangle to fill in. The contents will take the size of the icon image, the icon border size and -- if you provide RastPort and label text -- the icon label into account. Due to how labels are printed, the rectangle^.MinX and rectangle^.MinY members may be negative.

Tags

  

Additional drawing options to be taken into account. (ICONDRAWA_*)

Description

This function will calculate the size of the area icon rendering would affect.

Notes:

This function can be used to optimize on-screen rendering by precalculating the area rendering would cover. To make sure that the precalculated area size matches the one covered by the actual drawing operation, the RastPorts you use for measuring and for drawing should share the same font and the same text styles.

The image size calculated by this function can be slightly larger than the data you will find in the icon's do_Gadget.GadgetRender Image structure since the icon border will be taken into account. This happens regardless of whether icon.library was switched into frameless icon rendering mode or whether the icon is frameless. To obtain the size of the icon without taking the border into account, use the ICONDRAWA_Borderless tag.

See also

DrawIconStateA

  

Draw an icon as if it were an image

IconControlA

  

Set and get icon and icon.library options


Documentation generated on: 2021-07-30