|
||
NOTE: Since the CODE template is identical to the BUTTON Control template, we will NOT be duplicating the content about how to set things at this time.
Please refer here for details.
The ProImageAddTextToImageViaCODE template can be used just about anywhere.
It provides a way for you to add text to an image under program control at any time.
For example, let's say that you wanted to display a Copyright notice on the bottom of any image displayed in an ImageEx Viewer control.
NOTE: The ImageAssembler does not have to update the file on disk, it can actually add the text to the image and then update it in the control!
To do this via code we would declare a variable to hold our copyright notice (easier to change at runtime rather than in the templates as static text).
Then in the Open Window embed we could set the value:
Then add the ProImageAddTextToImageViaCODE template after the value was set:
First we set the Image Source to be the ImageExBitmapClass object of the viewer control - IEView.Bitmap in this case:
Next we set the Image Target to be the ImageExBitmapClass object of the same viewer control - again, IEView.Bitmap:
To add the copyright text to the bottom of the image we insert a line using the Bottom Caption button:
Then we set the caption properties as shown here:
The value of the variable Copyright gets added to a copy of the original bitmap using the font selection shown and with no background color.
Then the new bitmap is reloaded into the ImageEx viewer control as shown here:
Since the CODE template was added in the Open Window embed, all of this takes place before the original image is ever displayed.
Also since we were only updating the viewer's bitmap, the original image was not modified in any way.