Class: Exerb::Resource::GroupIcon::Entry
- Inherits:
-
Object
- Object
- Exerb::Resource::GroupIcon::Entry
- Defined in:
- lib/exerb/resource/group_icon.rb
Instance Attribute Summary collapse
-
#bit_count ⇒ Object
Returns the value of attribute bit_count.
-
#height ⇒ Object
Returns the value of attribute height.
-
#id ⇒ Object
Returns the value of attribute id.
-
#size ⇒ Object
Returns the value of attribute size.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(id, width, height, bit_count, size) ⇒ Entry
constructor
A new instance of Entry.
- #pack ⇒ Object
Constructor Details
#initialize(id, width, height, bit_count, size) ⇒ Entry
Returns a new instance of Entry.
48 49 50 51 52 53 54 |
# File 'lib/exerb/resource/group_icon.rb', line 48 def initialize(id, width, height, bit_count, size) @id = id @widht = width @height = height @bit_count = bit_count @size = size end |
Instance Attribute Details
#bit_count ⇒ Object
Returns the value of attribute bit_count.
56 57 58 |
# File 'lib/exerb/resource/group_icon.rb', line 56 def bit_count @bit_count end |
#height ⇒ Object
Returns the value of attribute height.
56 57 58 |
# File 'lib/exerb/resource/group_icon.rb', line 56 def height @height end |
#id ⇒ Object
Returns the value of attribute id.
56 57 58 |
# File 'lib/exerb/resource/group_icon.rb', line 56 def id @id end |
#size ⇒ Object
Returns the value of attribute size.
56 57 58 |
# File 'lib/exerb/resource/group_icon.rb', line 56 def size @size end |
#width ⇒ Object
Returns the value of attribute width.
56 57 58 |
# File 'lib/exerb/resource/group_icon.rb', line 56 def width @width end |
Instance Method Details
#pack ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/exerb/resource/group_icon.rb', line 58 def pack case @bit_count when 4 then cc, bc = 16, 4 when 8 then cc, bc = 0, 8 when 24 then cc, bc = 0, 0 # cjc 2015-11-06 else raise "invalid bit count -- #{@bit_count}" end icon_dir_entry = Exerb::Win32::Struct::IconResEntry.new icon_dir_entry.width = @widht icon_dir_entry.height = @height icon_dir_entry.color_count = cc icon_dir_entry.reserved = 0 icon_dir_entry.planes = 1 icon_dir_entry.bit_count = bc icon_dir_entry.bytes_in_res = @size icon_dir_entry.image_offset = @id return icon_dir_entry.pack end |