OpenNTF.org - Lotus Script class to create G
My Links (Not logged in)
Code Bin Search
 
Hosted by Prominic.NET
Rate This Code
5 - brilliant stuff
4 - very nice
3 - average
2 - needs work
1 - bad
   OpenNTF Code Bin
About This Code
Brief Description:
Lotus Script class to create GIF and BMP images from within Notes 
Rating:
Rating: 4.75 , Number of votes: 4 
Contributor:
Guido Purper 
Category:
Lotusscript 
Type:
Miscellaneous 
Document Release:
1.01 
Notes Version:
R6.x 
Last Modified:
03 Jan 2005 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
I have developed this class to present statistical data in visual form (as graphs) and send them to some people automatically.


You can create 256-color images on-the-fly from within Notes, attach or embedd the images to HTML/MIME documents and send them to other people. This is not a "Paint" application, there is no way of interaction. This is a class to create images by Lotos script e.g. from an agent.

Features:
========
- 256 color images, Websafe palette predefined
- Color palette can be modified
- SetPixel, Line, LineTo, Circle, Ellipse, FloodFill
- Scalable vector-based text
- Output as NotesStrem will allow you to ...
..... Export image as GIF (compressed and uncompressed)
..... Export image as BMP (uncompressed)
..... Embedd or attach images to MIME messages
- Transparency (GIF)


Limitations:
==========
- 256 color images only (GIF and BMP)
- Only one global color palette per image (GIF)
- No support for animated GIF
- No image import
- R6 only
- HTML / MIME messages will not be rendered correctly by Notes 5 clients

Performance:
===========
Because everything is coded in LS, this class should run on all supported platforms. However LS is not as fast as external libraries.
The performance on writing the data to the stream - esp. for the GIF methods - is slow because the code for LZW compression is not optimized for speed but for functionality and readability.
I had some troubles writing non ASCII characters into a stream, therefore some Char-to-Byte conversion was needed will slow it down.

To embedd images to HTML/MIME mails you should have some basic knowledge on HTML and creating MIME messages.... or have a look to the examples included

Comments / enhancements welcome.

Usage / Example
See the "About" document for more information

The agents included will show you
- how to create images and how to use the graphical methods
- how to create HTML/MIME messages
- how to embedd images into MIME messages
- how to attach images to MIME messages
- how to write images to local harddisk
- how to attach images to notes documents
Code Attachments
NotesImage.zip (138 Kbytes)
 Comments
Posted by umesh kns on 12/05/2005 03:00:27 AMerror handling for notesstream.writetext
How to code for the error handling mechanism of notesstream.writetext....?
Posted by Guido Purper on 12/05/2005 03:30:31 AMRe: error handling for notesstream.writetext
Sorry, I don't get the point. Can you be more specific?
If you create a stream to write data into a file, you should make sure the file does not exist.
For in-memory streams no error should occure.
So I don't understand. What error should be handled, when does the error happen?
 Add your comment!