Difference between revisions of "TrayItem.Icon"

From Xojo Documentation

m
Line 10: Line 10:
 
{{Description
 
{{Description
 
|text = The icon displayed as the '''TrayItem'''. }}
 
|text = The icon displayed as the '''TrayItem'''. }}
 
==Example==
 
 
This example project is in the Examples folder that ships with Real Studio. It is the constructor for the '''TrayItem''' that is built in this example. The constructor creates an animated icon that is made up of a sequence of still images.
 
 
The constructor uses four bitmaps to create an animated '''TrayItem''' and adds a helptag. The icon images have been dragged to the Project Editor. The images are in the project’ Icons folder.
 
 
<rbcode>
 
  // Take our masked picture and turn
 
  // it into a true icon (with mask support)
 
  dim p as Picture
 
  p = New Picture( Save32.Width / 2, Save32.Height, 32 )
 
  p.Graphics.DrawPicture( Save32, 0, 0, p.Width, p.Height )
 
  p.Mask.Graphics.DrawPicture( Save32, 0, 0, p.Width, p.Height, p.Width, 0, p.Width, p.Height )
 
  mIcons( 0 ) = p
 
 
 
  p = New Picture( Save322.Width / 2, Save322.Height, 32 )
 
  p.Graphics.DrawPicture( Save322, 0, 0, p.Width, p.Height )
 
  p.Mask.Graphics.DrawPicture( Save322, 0, 0, p.Width, p.Height, p.Width, 0, p.Width, p.Height )
 
  mIcons( 1 ) = p
 
 
 
  p = New Picture( Save323.Width / 2, Save323.Height, 32 )
 
  p.Graphics.DrawPicture( Save323, 0, 0, p.Width, p.Height )
 
  p.Mask.Graphics.DrawPicture( Save323, 0, 0, p.Width, p.Height, p.Width, 0, p.Width, p.Height )
 
  mIcons( 2 ) = p
 
 
 
  p = New Picture( Save324.Width / 2, Save324.Height, 32 )
 
  p.Graphics.DrawPicture( Save324, 0, 0, p.Width, p.Height )
 
  p.Mask.Graphics.DrawPicture( Save324, 0, 0, p.Width, p.Height, p.Width, 0, p.Width, p.Height )
 
  mIcons( 3 ) = p
 
 
 
  me.Icon = mIcons( 0 )
 
  me.HelpTag = "Save your world!  Buy Aaron a beer."
 
</rbcode>
 

Revision as of 15:53, 24 May 2013

Property (As Picture )
aTrayItem.Icon = newPictureValue
or
PictureValue = aTrayItem.Icon

Supported for all project types and targets.

The icon displayed as the TrayItem.