Class: Camellia::CamImage

Inherits:
Object
  • Object
show all
Defined in:
lib/camellia-fox.rb

Instance Method Summary collapse

Instance Method Details

#to_fox(app, picture = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/camellia-fox.rb', line 22

def to_fox(app, picture=nil)
  if picture==nil
    pict=FXImage.new(app, nil, IMAGE_OWNED|IMAGE_KEEP, width, height)
  else
    pict=picture
  end if
  image=CamImage.new(width, height, CAM_DEPTH_8U, CAM_COLORMODEL_RGBA)
  copy(image)
  FXStream.new { |stream|
    stream.open(FXStreamLoad, image.imageSize, image.to_s)
    unbound_loadPixels=FXImage.instance_method(:loadPixels)
    bound_loadPixels=unbound_loadPixels.bind(pict)
    bound_loadPixels.call(stream)
  }
  return pict
end