08-22-2007 12:28 AM
08-22-2007 11:28 AM
Hi Sof,
Back to the Active X approach ....
The image for the annotation should located at a URL (possibly a location on your hard drive). You can modify that picture (you can call GetURL if you need to get the location of the URL programmatically), and then call Reload() on your image.
Here are some code snippets for C++:
m_GraphData.Annotations.Item(1).Shape.Type = CNiShape::Picture;
m_GraphData.Annotations.Item(1).Shape.Image.Url =
"c:\\image.bmp";m_GraphData.Annotations.Item(1).Shape.Image.BlinkInterval = CNiImage::SpeedOff;
m_GraphData.Annotations.Item(1).Shape.Image.Reload;
CNiImage myImage = m_GraphData.Annotations.Item(1).Shape.GetImage();
08-22-2007 01:22 PM
Oh yea, I forgot the original intention of the post.
I'm not sure I'm following you. Your code snippet sets the Shape image, loads it, and gets it. But once I get the CNiImage how can I modify the bitmap? The image is still an CNiPicture, which as far as I can tell, doesn't do me alot of good.
What I need to do is:
1. get the image of the annotation
2. do my custom mods to the annotation image
3. assign that image back to that annotation image
Thanks,
Scott
08-22-2007 01:34 PM
Hi Scott,
These is a predefined set of images that will be displayed for the annotations, right? It seems like the best way would be to programmatically switch one image out for another. For example, if you had a set of image files that are different colored squares, you could replace the image with another one in that set.
08-22-2007 02:27 PM
AnimateColumns | Specifies the number of columns in a bitmap that is being used for animation. |
AnimateInterval | Specifies how often an image animates. |
AnimateRows | Specifies the number of rows in a bitmap that is being used for animation. |
BlinkInterval | Specifies how often the image blinks. |
Color | Specifies the color of the image, or, if you are doing dynamic color substitution in Windows metafiles, the color in the image that you want to replace. |
FlipH | Flips an image horizontally. |
FlipV | Flips an image vertically. |
Picture | Specifies the image used in the CWImage object. |
ReverseAnimation | Specifies the direction of animation. |
SaveLink | Specifies if the CWImage object saves the image itself or a link to the image. |
Stretch | Specifies if the image is displayed normal size or stretched to fit the size available within the control. |
Substitute | Specifies that you want to perform dynamic color substitution in the metafile image if set to True. |
SubstituteColor | Specifies the color that will replace a specified color in the metafile image. |
Tile | Specifies if the image is tiled. |
Tolerance | Specifies the percentage for matching color hues on the image to the SubstituteColor property. |
Transparent | Specifies if the image has a transparent color. |
TransparentColor | Specifies the color in the image that must be drawn as transparent. |
URL | Specifies the path to the image. |
Visible |
Specifies if the image is visible or not. |
In particular, color will let you change the color of the picture. Another option is to use a native .NET library (you already have the saved file, so you can load it and do any image processing on it). An example .NET program (including source code) is: http://www.getpaint.net/
08-23-2007 07:28 PM
I tried this but it did not change the color in my wmf from Red to Blue. I tried setting different tolerances from 0-100 and nothing worked. If I could get this working that would solve my problem.
_Anno.Shape.Image.CWImage.URL =
@"C:\Users\DevAccount\Desktop\TriangleWMF.wmf";08-24-2007 11:16 PM
08-31-2007 11:53 PM
Hi Sof,
This was reported to R&D (4CUMHLNM) for further investigation. For now, you may want to try a .NET Library to change the color of the image, using the info I suggested in an earlier post.
09-11-2007 04:40 PM
09-11-2007 06:26 PM