04 MIDAS CLASSES/GeniiRTChunk

GraphicWidth property
Version added: 1.50
Read-write.   The  GraphicWidth property represents the width (in inches or pixels depending on the  GraphicUnit property when reading and the ImageInPixels property when writing) of an embedded picture or graphic.  Setting this property to 0.0 will reset the image to its original width, but may also change the type of unit, so both height and width should be set together in most cases.  The  GraphicRatio property is the aspect ratio of height to width, so to increase proportionally, set the height and then set the width to the height times the ratio.  To set the image in pixels, set the ImageInPixels property to True and then set the height and width in pixels.
Defined in
GeniiRTChunk class
Data type
Single
Syntax
To get:  hieght = geniiRTChunk .GraphicWidth
To set:  geniiRTChunk .GraphicWidth =  height
Usage
Used to adjust the size of a graphic image, no matter what format the orginal image was created from (GIF, JPEG, bitmap).  See also the  GraphicHeight property .

Example
' ***  Button formula for button called Re-size  Picture
Sub  Click(Source As Button)
  Dim ui  As New NotesUIWorkspace
  Dim uidoc  As NotesUIDocument
  Dim doc As  NotesDocument
  Dim db As NotesDatabase
     
  Dim rtitem  As New GeniiRTItem
  Dim rtchunk  As GeniiRTChunk
     
   Dim widthstr As String
  Dim  heightstr As String
     
  Dim widthval As Single
   Dim heightval As Single
     
  Dim mode As Variant
   Dim unid As String
   Dim noteid As String
     
  Set uidoc = ui.CurrentDocument
   Set doc = uidoc.Document
  Set  db = doc.ParentDatabase
     
  mode = uidoc.EditMode
  If  uidoc.Editmode Then uidoc.Save
  noteid  = doc.NoteID
  uidoc.Close
  Delete  doc
     
  Call  rtitem.Connect(db.Server, db.FilePath, noteid, " Body", True)
  Set rtchunk =  rtitem.DefineChunk("Everything")
  widthstr  = Inputbox$("Revise the width (currently  " & Cstr(rtchunk.
GraphicWidth ) &  """) of the mage in  inches: ", "Width in Inches")
  widthval = Csng(widthstr)
   heightstr = Inputbox$("Enter the height  (currently " & Cstr(rtchunk.GraphicHeight)  & """)  of the mage  in inches: ", "Width in Inches" )
   heightval = Csng(heightstr)
   rtchunk.GraphicHeight = heightval
  rtchunk.
GraphicWidth  =  widthval
   rtitem.Save

   Set doc = db.GetDocumentByID(noteid)
      
  Call ui.EditDocument(mode,  doc)
End Sub