I'm trying to create web dialogs to display component information that I would like to be able to save as an image which can then be placed into a model. The purpose is to get rich text instead of the limitations of the text box or 3D text tools.
The idea was started after pondering a suggestion of ThomThom's to use WebDialogs.
So I created a really generic html file called 'wrwtools/generictest.html':
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Generic HTML Test Page</title>
</head>
<body>
<h1>Basic Web Dialog</h1>
<table>
<tr><th> </th><th>Value</th></tr>
<tr><td>DMX Address</td><td>123</td></tr>
<tr><td>Channel</td><td>101</td></tr>
<tr><td>Fixture Number</td><td>32</td></tr>
</table>
</body>
</html>
Then I created a very generic test application script:
require 'sketchup.rb'
#-----------------------------------------------------------------------------
module WRW_textpanes
# Global variable for where export images will go.
# Global variable for where template files are stored.
### MENU & TOOLBARS ### --------------------------------------------------
unless file_loaded?( File.basename(__FILE__) )
root_menu = ($wrw_menu) ? $wrw_menu ; UI.menu('Plugins')
root_menu.add_item('Web Dialog Write Test') { self.webdialogwritetest }
end
def self.webdialogwritetest
html_dialog = UI;;WebDialog.new("Web Dialog Test", true,"", 700, 600, 150, 150, true);
path = Sketchup.find_support_file "wrwtools/generictest.html","Plugins"
html_dialog.set_file path
html_dialog.show
# Simple html dialog shown now see if it will save.
html_dialog.write_image "c;/production/sketchup/wrwtesting/shouldbewebdialog.jpg"
end
end #module
#-----------------------------------------------------------------------------
file_loaded( File.basename(__FILE__) )
I was hoping shouldbewebdialog.jpg would be an image of the simple html instead I'm getting an image that is blank tan box about 300x300 in size. Its kind of like an empty messages portion of the "ruby console" dialog box.
I did have additional x,y,height,width type values after the filename, but removed them after reading this post http://forums.sketchucation.com/viewtopic.php?f=180&t=17047&start=285#p231504 but I'm still getting the same results.
I'd appreciate any help.