Genii Weblog


Civility in critiquing the ideas of others is no vice. Rudeness in defending your own ideas is no virtue.


Fri 13 Jan 2006, 01:39 PM
Here is the next in my customer inspired list of the top ten ways to use Midas which I started a few days ago with MRTYB with Midas #10 - Rich text comparison with red-lining , continued two days ago with #9 - Manage doclinks, URL links and link hotspots, added to yesterday with #8 - Building dynamic forms.  I now offer #7...







#7) Work with images in rich text and in image resources

Description
Midas has long allowed developers to access and modify images, referred to as graphics in some cases.  From the early days when all images were stored in internal Notes bitmap format to the current images that may be JPEG or GIF images, and may be stored in native form or as attachments or even URLs, and even image resources that may be included in a rich text field or on a form, Midas has given access to all of them.

History
The ability to import images has been available since Version 1.00 in June, 1997.  As additional formats have been added, Midas has been enhanced to handle the new formats, then to add image resources, and finally to modify the attributes on graphics such as alt text, image hotspots, and image flow (how text flows around the image).  As recently as Version 3.20, we have added the ability to convert Notes bitmap images into GIF images, thereby saving a great deal of space and making export of the Notes bitmap images possible.

Comparison with standard Notes/Domino functionality
Notes 6.x has incorporated some ability to access images, but mostly only to delete them or move them about.  There is no facility in the backend to import images, no facility to modify the attributes of the image, no facility to export or extract the images.  In short, the Notes model barely handles images at all.

Documentation
Documented in the Help database by looking at the properties, methods and events associated with importing, exporting and modifying graphics, including the AppendGraphic method, ExportGraphic methid and SetTargetProperties method, as well as a series of properties such as GraphicWidth and GraphicHeight, GraphicFormat (which shows whether the graphic is in Notes bitmap format, JPEG or GIF format or an image resource), and GraphicOffset, which the special offset needed to use in URL's which reference the graphic directly from the rich text.

On-line demo
None available at this time.

Sample Database
Graphics are used so extensively that there are no specific samples dedicated to their use, but graphics are used in samples such as Walden, Jose's Keyword Replacements, Generate HTML, Export To MS Word, etc.  If we add a Graphics-specific sample, I'll change this post to reflect that.
Sample Script Snippet
This is adapted from a Help database script:

Set rtchunk = rtitem.DefineChunk("Graphic 1")
found = False
While rtchunk.Exists And Not found
  If rtchunk.GraphicFormat = "Notes Bitmap" Then
    Call rtchunk.ConvertBitmaps("Format=GIF")
  End If
  Call rtchunk.ExportGraphic(path & doc.NoteID & "_" & rtchunk.GraphicFormat & "." & rtchunk.GraphicFormat)
  found = True
  rtchunk.GetNextTarget
Wend

Copyright © 2006 Genii Software Ltd.