3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/asposediagramjava/Shapes/getshapeicon.rb', line 3
def initialize()
data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
diagram = Rjb::import('com.aspose.diagram.Diagram').new(data_dir + "Basic_Shapes.vsd")
master = diagram.getMasters().getMasterByName("Circle")
bytes = master.getIcon()
fos = Rjb::import('java.io.FileOutputStream').new(data_dir + "MyImage.png")
fos.write(bytes)
fos.close()
puts "Get shape icon, please check the output file."
end
|