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

Change image size

Start search Mail feedback Back to Description


rtGraphic

addNewLine (rtContainer) addNewLine (rTextParagraph) appendText (rtContainer) appendText (rTextParagraph) getFirstElement (rtCollection) getFirstElement (rtContainer) getNextElement (rtCollection) getNextElement (rtContainer) getRichTextItem PicHeight PicWidth sizeInPixels

Code fragment from sample "Change image size"; see full running samples in downloadable help.
call ctxDump.getRichTextItem(doc,"Body")
Dim img as rtGraphic
Dim uom as string

ctxDump.addNewLine 1
ctxDump.appendText rtLibSession.versioninfo
ctxDump.addNewLine 1

set img = ctxDump.getFirstElement (RT_OBJ_GRAPHIC)
do while not img is Nothing
img.picHeight = img.picHeight * (rnd *4) ' random change in size
img.sizeInPixels = (rnd*10000 mod 2)' and random UOM - pixels/twips
ctxDump.addNewLine 1
if img.sizeInPixels then
UOM = " (px)"
Else
UOM = " (twips)"
End if
ctxDump.appendText "size=" &img.picHeight & "x" & img.picWidth &UOM
set img = ctxDump.getNextElement (RT_OBJ_GRAPHIC, img)
Loop