Class: Wx::Region
- Defined in:
 - lib/wx/doc/gen/region.rb
 
Overview
This class is untracked and should not be derived from nor instances extended!
A Region represents a simple or complex region on a device context or window.
This class uses reference counting and copy-on-write internally so that assignments between two instances of this class are very cheap. You can therefore use actual objects instead of pointers without efficiency problems. If an instance of this class is changed it will create its own data internally so that other instances, which previously shared the data using the reference counting, are not affected. Predefined objects/pointers:
- 
NullRegion
 
Category: Data Structures, Graphics Device Interface (GDI)
Instance Method Summary collapse
- 
  
    
      #clear  ⇒ void 
    
    
  
  
  
  
  
  
  
  
  
    
Clears the current region.
 - #contains(*args) ⇒ Object
 - 
  
    
      #convert_to_bitmap  ⇒ Wx::Bitmap 
    
    
  
  
  
  
  
  
  
  
  
    
Convert the region to a black and white bitmap with the white pixels being inside the region.
 - 
  
    
      #get_box  ⇒ Wx::Rect 
    
    
      (also: #box)
    
  
  
  
  
  
  
  
  
  
    
Returns the outer bounds of the region.
 - 
  
    
      #initialize(*args)  ⇒ Region 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Region.
 - #intersect(*args) ⇒ Object
 - 
  
    
      #is_empty  ⇒ Boolean 
    
    
      (also: #empty?)
    
  
  
  
  
  
  
  
  
  
    
Returns true if the region is empty, false otherwise.
 - 
  
    
      #is_equal(region)  ⇒ Boolean 
    
    
      (also: #equal?)
    
  
  
  
  
  
  
  
  
  
    
Returns true if the region is equal to, i.e.
 - #offset(*args) ⇒ Object
 - #subtract(*args) ⇒ Object
 - #union(*args) ⇒ Object
 - #xor(*args) ⇒ Object
 
Methods inherited from GDIObject
Methods inherited from Object
#clone, #dup, #is_same_as, #un_share
Constructor Details
#initialize ⇒ Wx::Region #initialize(x, y, width, height) ⇒ Wx::Region #initialize(topLeft, bottomRight) ⇒ Wx::Region #initialize(rect) ⇒ Wx::Region #initialize(region) ⇒ Wx::Region #initialize(points, fillStyle = Wx::PolygonFillMode::ODDEVEN_RULE) ⇒ Wx::Region #initialize(bmp) ⇒ Wx::Region #initialize(bmp, transColour, tolerance = 0) ⇒ Wx::Region
Returns a new instance of Region.
      114  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 114 def initialize(*args) end  | 
  
Instance Method Details
#clear ⇒ void
This method returns an undefined value.
Clears the current region.
The object becomes invalid, or null, after being cleared.
      120  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 120 def clear; end  | 
  
#contains(x, y) ⇒ Wx::RegionContain #contains(pt) ⇒ Wx::RegionContain #contains(x, y, width, height) ⇒ Wx::RegionContain #contains(rect) ⇒ Wx::RegionContain
      166  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 166 def contains(*args) end  | 
  
#convert_to_bitmap ⇒ Wx::Bitmap
Convert the region to a black and white bitmap with the white pixels being inside the region.
This method can’t be used for invalid region.
      172  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 172 def convert_to_bitmap; end  | 
  
#get_box ⇒ Wx::Rect Also known as: box
Returns the outer bounds of the region.
This method returns 0-sized bounding box for invalid regions.
      48  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 48 def get_box; end  | 
  
#intersect(x, y, width, height) ⇒ Boolean #intersect(rect) ⇒ Boolean #intersect(region) ⇒ Boolean
      216  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 216 def intersect(*args) end  | 
  
#is_empty ⇒ Boolean Also known as: empty?
Returns true if the region is empty, false otherwise.
Always returns true if the region is invalid.
      222  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 222 def is_empty; end  | 
  
#is_equal(region) ⇒ Boolean Also known as: equal?
Returns true if the region is equal to, i.e. covers the same area as, another one.
If both this region and region are both invalid, they are considered to be equal.
      230  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 230 def is_equal(region) end  | 
  
#offset(x, y) ⇒ Boolean #offset(pt) ⇒ Boolean
      66  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 66 def offset(*args) end  | 
  
#subtract(rect) ⇒ Boolean #subtract(region) ⇒ Boolean
      259  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 259 def subtract(*args) end  | 
  
#union(x, y, width, height) ⇒ Boolean #union(rect) ⇒ Boolean #union(region) ⇒ Boolean #union(bmp) ⇒ Boolean #union(bmp, transColour, tolerance = 0) ⇒ Boolean
      331  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 331 def union(*args) end  | 
  
#xor(x, y, width, height) ⇒ Boolean #xor(rect) ⇒ Boolean #xor(region) ⇒ Boolean
      375  | 
    
      # File 'lib/wx/doc/gen/region.rb', line 375 def xor(*args) end  |