Class: Quartz::BitmapContext
- Inherits:
-
Object
- Object
- Quartz::BitmapContext
- Defined in:
- lib/rubyquartz/bitmap_context.rb
Instance Attribute Summary collapse
-
#bitmap ⇒ Object
readonly
Returns the value of attribute bitmap.
Instance Method Summary collapse
- #copy_image ⇒ Object
-
#initialize(width, height, options = {}) ⇒ BitmapContext
constructor
A new instance of BitmapContext.
Constructor Details
#initialize(width, height, options = {}) ⇒ BitmapContext
Returns a new instance of BitmapContext.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rubyquartz/bitmap_context.rb', line 30 def initialize(width, height, ={}) raise "Width must be an integer" if width.to_i != width raise "Height must be an integer" if height.to_i != height super() colorspace = [:colorspace] || ColorSpace.new(:name => ColorSpace::GENERIC_RGB) # Record the bitmap as an ivar so it is retained. _initialize grabs a pointer, so losing this ivar can cause crashes. @bitmap = Quartz::Bitmap.new(width, height, colorspace, ) _initialize(@bitmap, colorspace) end |
Instance Attribute Details
#bitmap ⇒ Object (readonly)
Returns the value of attribute bitmap.
28 29 30 |
# File 'lib/rubyquartz/bitmap_context.rb', line 28 def bitmap @bitmap end |