Class: Fzeet::PARGB32

Inherits:
Handle
  • Object
show all
Includes:
BitmapMethods
Defined in:
lib/fzeet/windows/core/Common.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, width = 0, height = 0) ⇒ PARGB32

Returns a new instance of PARGB32.



244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/fzeet/windows/core/Common.rb', line 244

def initialize(path, width = 0, height = 0)
  @handle = Windows.DetonateLastError(FFI::Pointer::NULL, :LoadImage,
    nil,
    @path = path,
    Windows::IMAGE_BITMAP,
    width,
    height,
    Windows::LR_LOADFROMFILE | Windows::LR_CREATEDIBSECTION
  )

  attach
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



257
258
259
# File 'lib/fzeet/windows/core/Common.rb', line 257

def path
  @path
end

Instance Method Details

#disposeObject



259
# File 'lib/fzeet/windows/core/Common.rb', line 259

def dispose; Windows.DeleteObject(@handle); detach end