Class: Fox::FXIcon

Inherits:
FXImage show all
Defined in:
rdoc-sources/FXIcon.rb

Overview

An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask those pixels where the background should be preserved during the drawing, and a etch bitmap, which is used to draw the icon when it is disabled.

Instance Attribute Summary collapse

Attributes inherited from FXImage

#data, #dataPtr, #options, #pixels

Attributes inherited from FXDrawable

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

Methods inherited from FXImage

#blend, #crop, #fade, #fill, #getPixel, #gradient, #hasAlpha?, #hgradient, #initialize_without_data_string, #loadPixels, #mirror, #pixel_string, #release, #render, #restore, #rotate, #savePixels, #scale, #setPixel, #setPixels, #setPixels_without_data_string, #vgradient, #xshear, #yshear

Methods inherited from FXDrawable

#resize

Methods inherited from FXId

#create, #created?, #destroy, #detach, #runOnUiThread

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(app, pix = nil, clr = 0, opts = 0, width = 1, height = 1) ⇒ FXIcon

Create an icon with an initial pixel buffer pix, a transparent color clr, and opts as in FXImage. The transparent color is used to determine which pixel values are transparent, i.e. need to be masked out in the absence of a true alpha channel. If the flag IMAGE_OPAQUE is passed, the shape and etch bitmaps are generated as if the image is fully opaque, even if it has an alpha channel or transparancy color. The flag IMAGE_ALPHACOLOR is used to force a specific alpha color instead of the alpha channel obtained from the image file. Specifying IMAGE_ALPHAGUESS causes FXIcon to obtain the alpha color from the background color of the image; it has the same effect as IMAGE_ALPHACOLOR in the sense that the icon will be transparent for those colors matching the alpha color.

Parameters:

a

an application instance Fox::FXApp

pix

initial pixel buffer [String]

clr

transparency color Fox::FXColor

opts

options [Integer]

width

width [Integer]

height

height [Integer]


35
36
# File 'rdoc-sources/FXIcon.rb', line 35

def initialize(app, pix=nil, clr=0, opts=0, width=1, height=1) # :yields: theIcon
end

Instance Attribute Details

#transparentColorObject

Transparency color Fox::FXColor


11
12
13
# File 'rdoc-sources/FXIcon.rb', line 11

def transparentColor
  @transparentColor
end