| McNeel Wiki | |||||||||||||||||||||||
| edit · print · help · all topics | |||||||||||||||||||||||
Main Pages
Languages
|
GDI+ Font objectsGDI+ Font objects are required when GDI+ is drawing Text. The GDI+ Font object is quite extensive and some of its features are also available through the RhPicture Plugin:
Properties not available in the RhPicture font object:
Most of these properties are self-evident and need little elaboration. Note that you do not need Font objects to draw Strings in the RhPicture plugin. Every method that takes a Fnt object is overloaded and can be called with a font name as well:
Dim RhPicture : Set RhPicture = Rhin.GetPluginObject("RhPicture")
Call RhPicture.CreateImage(50, 50, vbWhite)
Call RhPicture.DrawString("Bacon Cheeseburger.", Array(5,5), "Courier", vbRed)
If you want to specify further properties, you'll have to use an RhPicture Font object. You can obtain a Font object by calling the Font creation method on RhPicture:
Dim RhPicture : Set RhPicture = Rhin.GetPluginObject("RhPicture")
Call RhPicture.CreateImage(50, 50, vbWhite)
Dim FontObj : Set FontObj = RhPicture.CreateFont("Courier", 15, True, True)
Call RhPicture.DrawString("Hold the pickles.", Array(5,5), FontObj, vbRed)
Note that you can store any number of Font objects in your script and you can reuse them as often as you like. Font objects are not bound to the RhPicture instance that created them and you can use them on any RhPicture object. There is only one Font creation methods available:
RhPicture.CreateFont(Optional FontName As String = "Arial", _
Optional FontSize As Double = 12.0, _
Optional Bold As Boolean = False, _
Optional Italic As Boolean = False, _
Optional Underline As Boolean = False) As GDIFont
| ||||||||||||||||||||||
| rename · changes · history · subscriptions · lost and found · references · file upload | |||||||||||||||||||||||