rtLib — Notes Rich Text Management Library Documentation of rtLib — Notes Rich Text Management Library Download rtLib — Notes Rich Text Management Library FAQ of rtLib — Notes Rich Text Management Library Purchase rtLib — Notes Rich Text Management Library Feedback about rtLib — Notes Rich Text Management Library

Cookbook

Create Image Resource

Start search Mail feedback Back to Description


rtdImageResource rtGraphic

add (rtContainer) addNewLine (rtContainer) addNewLine (rTextParagraph) Add (rtCollection) Add (rTextParagraph) getRichTextItem importFromFile (rtGraphic) Image ImportFromFile (rtdImageResource) Resource ResourceName

Code fragment from sample "Create Image Resource"; see full running samples in downloadable help.
Dim imgres as New rtdImageResource (ndb, "newtest")
imgres.importFromFile "c:\temp\dilbert.gif"
imgres.save ' the resource document is created, but in order to save changes from ImportFromFile we need to save in order to store image to disk

ctxDump.getRichTextItem doc, "Body"
ctxDump.add imgres.Image ' add the image we just imported, not the resource

' in order to add the newly created image resource itself
Dim img as New rtGraphic("")
img.ResourceName = "newtest" ' now we reference the newly created resource
ctxDump.addNewLine 1
ctxDump.add img ' the new image resource will not be visible until we re-open the database