# File locana/l_bitmap.rb, line 110 def load(str) @str = str raise ArgumentError, dfh(@str[0..256].inspect) + " is not a valid pixmap string" if (!@str.kind_of?(String)) a = @str.split("\n") raise ArgumentError, dfh(@str[0..256].inspect) + " is not a valid pixmap string" if (a.size < 2) pos = i = 0 bitmap_name = nil a.each_index do |i| if ((pos = a[i].index('_width'))) @width = a[i][pos+6..-1].strip.to_i bitmap_name = a[i][0..pos-1].split(' ')[-1] end if ((pos = a[i].index('_height'))) @height = a[i][pos+7..-1].strip.to_i end end @name = bitmap_name if (!@name) raise ArgumentError, dfh(@str[0..256].inspect) + " - empty image, w:#{@width}, h:#{@height}" if (@width <= 0 || @height <= 0) #@bitmap = a[i+1+@color_count..-1] return self end