34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/exerb/win32/icon_file.rb', line 34
def read(io)
base = io.pos
= Exerb::Win32::Struct::.read(io)
@entries = (1...count).collect {
Exerb::Win32::Struct::IconDirEntry.read(io)
}.collect { |icon_dir_entry|
io.seek(base + icon_dir_entry.image_offset)
= Exerb::Win32::Struct::.read(io)
io.seek(.position)
entry = Exerb::Win32::IconFile::Entry.new
entry.width = icon_dir_entry.width
entry.height = icon_dir_entry.height
entry.bit_count = .bit_count
entry.value = io.read(icon_dir_entry.bytes_in_res)
if entry.width == 0
entry.bit_count = icon_dir_entry.bit_count
entry.width = entry.height = 256
end
entry
}
return self
end
|