| McNeel Wiki | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| edit · print · help · all topics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Main Pages
Languages
|
The purpose of this projectThe Graphics Device Interface (or GDI) in Microsoft Windows is a base library for all platform graphics calls. Rhino supports a newer version of these libraries called GDI+ which enable the developer to use advanced drawing techniques such as anti-aliasing, transparancies, gradients and cleartype fonts. The essentials of GDI+ are now available for RhinoScripters through the use of this plugin. This project is aimed at those scripters who need to either analyze or create graphic data through automated processes. It is not a graphic editor and it is not for you if you're unfamiliar with RhinoScript.
For further questions slash requests, please:
Downloads
Nested Object definitionsRhPicture contains a number of Object definitions which are available only through RhPicture. These objects all have their own Wiki pages with information:
Namespace DescriptionSince this project comes with autocompletion definitions for the Monkey Script editor, I will not discuss every function in this plugin. Rather, I will give you a small breakdown on how the thing fits together from a logical point of view. For a more in depth reference to function parameters, see the other pages of this Wiki group.
Before you can use the tools exposed in this plugin, you first need to create an instance of it in your script. There's no limit to the amount of instances you can make, but be aware that every one potentially stores a large bitmap in the memory of your computer. In order to create a new instance of the RhPicture plugin, do the following:
Dim RhPicture : Set RhPicture = Rhino.GetPluginObject("RhPicture")
Note that autocompletion in Monkey only works if you name this variable "RhPicture". Once the subroutine completes the instance will be destroyed and the memory will be released. It is usually considered good practise to specifically release object instances once you no longer need them, thus:
Dim RhPicture : Set RhPicture = Rhino.GetPluginObject("RhPicture")
'Do whatever it is you do in here...
Set RhPicture = Nothing
File IO Methods Once you have your RhPicture instance, you can call its methods. By default, any new instance does not contain an image yet. You'll either have to load or create one before you can start drawing. There are several ways in which to load an image into an RhPicture instance:
RhPicture.LoadImage() As Boolean
RhPicture.LoadImage(ImageFileName As String) As Boolean
RhPicture.CreateImage(Width As Integer, Height As Integer) As Boolean
RhPicture.CreateImage(Width As Integer, Height As Integer, Background As GDIColor) As Boolean
RhPicture.LoadImageFromViewport(Optional ByVal ViewportName As String, _
Optional ByVal Width As Integer, _
Optional ByVal Height As Integer, _
Optional ByVal IncludeTitle As Boolean = True) As Boolean
The RhPicture plugin can load and save images in the following file formats:
All image data inside RhPicture instances is stored as 32bppARGB (32 bits-per-pixel Alpha Red Green Blue) meaning that JPEG, GIF and some TIFF and PNG compression options are lost when they are loaded. You can at all times display or save the image contained in an RhPicture instance using: RhPicture.SaveImage() As Boolean RhPicture.SaveImage(ImageFileName As String) As Boolean RhPicture.ShowImage() As Boolean RhPicture.ShowImage(ViewerTitle As String, Optional Stretch As Boolean = False) As Boolean
Analysis Methods Once you have your image (be it loaded or created), you can start to query its properties. There are both global and local properties:
Drawing methods There are many methods available for drawing geometry. See this wiki page for further details:
Filter methods There are many methods available for applying effects and filters to RhPicture images. See this wiki page for further details: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rename · changes · history · subscriptions · lost and found · references · file upload | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||