Tips for using ImageMan with MetaDraw
Using MetaDraw and ImageMan together is EASY
giving you POWER and FLEXIBILITY
Use MetaDraw for its support of vector image formats,
for annotation / drawing, for hotspots and diagramming.
Use ImageMan for its support of many raster image formats,
its scanning support, and its support for raster operations
( eg: brightness adjustment, contrast adjustment )
These notes below are intended only as an introduction.
Both MetaDraw and ImageMan offer an array of powerful features.
Please check out the documentation for each for further details.
-
To copy an image from ImageMan into MetaDraw
** Set one of MetaDraw's picture properties to ImageMan's
vbPicture property
-
Set MetaDraw image from ImageMan
MetaDraw.Picture = ImageMan.vbPicture
-
Merge image into existing MetaDraw image
MetaDraw.PictureClip = ImageMan.vbPicture
-
Set MetaDraw editing to allow user insertion of ImageMan image with mouse
' insert picture into MetaDraw buffer
MetaDraw.PictureImage = ImageMan.vbPicture
' put user into merge image drawing mode
MetaDraw.EditMode = ED_IMAGE
The user can draw this image into MetaDraw
at any location with the mouse.
-
Set Background layer in MetaDraw ( behind annotation layer )
' Set the background layer
MetaDraw.BackPicture = ImageMan.vbPicture
' Synchronize scroll and zoom of background with annotation layer
MetaDraw.PictureOptions = MetaDraw.PictureOptions
OR PICOPT_PICTUREBACKGROUND
** NOTE - the above is for OCX editions of MetaDraw
and ImageMan
For .NET editions use
'MetaDraw1.LoadPicture(AxImageControl1.Picture, _
BTIS.MetaDraw.PictureSource.Picture, _
BTIS.MetaDraw.PictureType.None)
-
To copy back from MetaDraw to ImageMan
Set ImageMan's vbPicture with one of MetaDraw's Picture properties
Note that the PictureType must be set to Bitmap for the transfer
but once transferred the image may be saved in any supported image format.
Also note that the background layer may be included or not depending on
the setting of the ExportOptions property.
-
Copy MetaDraw Annotation Layer to ImageMan
' Set MetaDraw's PictureType property to PICTYPE_BITMAP for transfer
' Image can be later saved by ImageMan in any ImageMan format
MetaDraw.PictureType = PICTYPE_BITMAP
' Specify that Background Layer should NOT be included
MetaDraw.ExportOptions = MetaDraw.ExportOptions
AND NOT EXOPT_BACKGROUND
' Copy the Picture
ImageMan.vbPicture = MetaDraw.Picture
-
Copy complete MetaDraw picture - including background layer to ImageMan
' Set MetaDraw's PictureType property to PICTYPE_BITMAP for transfer
' Image can be later saved by ImageMan in any ImageMan format
MetaDraw.PictureType = PICTYPE_BITMAP
' Specify that Background Layer should be included
MetaDraw.ExportOptions = MetaDraw.ExportOptions
OR NOT EXOPT_BACKGROUND
' Copy the Picture
ImageMan.vbPicture = MetaDraw.Picture
-
Copy selected annotations in MetaDraw to ImageMan
MetaDraw.PictureType = PICTYPE_BITMAP
MetaDraw.Current = OBJ_Selected
ImageMan.vbPicture = MetaDraw.PictureClip
-
Within MetaDraw you can Edit Images by Code or allow end-user drawing
-
Allow End-User Drawing
MetaDraw has numerous EditModes to allow
different user actions. Just set the EditMode property
to allow Drawing Shapes, Adding Text, Selecting Objects
MetaDraw.EditMode = ED_ELLIPSE
-
Draw by Code
MetaDraw will allow you to add new text, shapes or images
to an existing image by code. Just call the AddObject method
MetaDraw.AddObject OT_RECTANGLE, X1, Y1, X2, Y2
-
Within ImageMan you can adjust brightness and contrast
Scan images, save and load to a wide variety of formats
-
Adjust the Brightness
Set Brightness to 0 for default brightness.
Set to an integer from -1 to -255 to lighten the image
or to an integer from 1 to 255 to darken it.
ImageMan.Brightness 100
-
Adjust the Contrast
The contrast ( for 16, 24 or 32 bit images )
can be adjusted independantly for Red, Green, and Blue channels
' reduce contrast by 50% for all colors
ImageMan.Contrast 50, -1, 7