Class | Fox::FXIconSource |
In: |
rdoc-sources/FXIconSource.rb
|
Parent: | FXObject |
An icon source is an object that loads an icon of any type. It exists purely for convenience, to make loading icons simpler by concentrating the knowledge of the supported icon formats in a single place. Needless to say, this class is subclassable, allowing users to add additional icon types and make them available to all widgets which deal with icons. Note, the icons are loaded, but not created (realized) yet; this allows users to manipulate the pixel data prior to realizing the icons.
Load an icon of a given type (e.g. "gif") from reswrapped data. Returns nil if there‘s some error loading the icon. (The optional type parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted). Returns a reference to the icon.
Load an icon from the file filename. By default, the file extension is stripped and used as the icon type; if an explicit icon type is forced, then that type is used and the extension is ignored. For example, loadIcon("icon", "gif") will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the icon. Returns a reference to the icon.
Load an icon of a given type (e.g. "gif") from an already open stream. Returns nil if there‘s some error loading the icon. (The optional type parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted). Returns a reference to the icon.
Load an image of a given type (e.g. "gif") from reswrapped data. Returns nil if there‘s some error loading the icon. (The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the icon format if the parameter is omitted).
Load an image from the file filename. By default, the file extension is stripped and used as the image type; if an explicit image type is forced, then that type is used and the extension is ignored. For example, loadImage("image","gif") will try to load a CompuServe GIF file, since the filename does not give any clue as to the type of the image.
Load an image of a given type (e.g. "gif") from an already open stream. Returns nil if there‘s some error loading the image. (The optional parameter is actually mandatory at the time of this writing; future versions will attempt to inspect the first few bytes of the stream to divine the image format if the parameter is omitted).