Tutorial > Customized Warp
Customized Warp of Watermark Text

This artical is going to show how to customize a shape warp with CoolWatermark

Firstly, you need to set CoolWatemark.Shape.ShapeStyle to be Customize. And then, you will require to setup Shape.Dest, which is a 4-element PointF array.

Everytime you write a watermark, text or photo, it must be containted inside a rectangle. Just like the following:

The text will stay inside the rectangle.You can read this rectangle by CoolWatermark.BoundedArea after wriiting the watermark.

Normally, a rectangle has 4 points: left-top, right-top, left-bottom, and right-bottom. What you need to do is set difference for those 4 points in this property. Therefore, setting zero to all of them means no warp occurs. You don't need the BoundedArea here, because you only set the difference to each point.

The above image has a normal watermark text in the center. Now I will write another text with a customized warp on the same image.

The setting is like the following:

It means I move up the rectangle's right-top position 50, and move down the rectangle's right-bottom position 50.

And finally, it will draw the text like the following. The black line is to show you the warped rectangle, they are not in the actual picture.

Now, let's see how to implement a ZoomUpper shape effect.

We can setup the Shape.Dest like the following:

It means I increase X-coordination of left-top position, and decrease X-coordination of right-top position. Just like to shrink the top line of the rectangle.

It will draw the text like this:

Have you learnt how to customize the shape warp? Try with the test demo application, you will find more interesting shape.

Send comments about this topic.
Copyright (c) 2006 @ ImageComponent.NET. All rights reserved.