Tutorial > Halo Text
Halo Watermark Text

This artical is to show how to write halo text.

Halo is a new effect style in CoolWatermark 1.1. Writing halo text requires two color defined in Writer.Colors. Therefore, it doesn't work with Gradient brush style. We will talk about that how to use them together.

Also, Halo doesn't work with Border.

Firstly, let's try the simplest halo text. ( I am not going to show the code, because that's very simple, no difference to other effect styles ). I set Color[0] to be black, Color[1] to be white, and set Shape.Distance to be 5. It will write out the following watermark text.

With some colors, it might give you special effects. For example, (a burning text?)

Color[0] = #C0C0C0        Color[1] = #FF8080

Halo is like other effects, it is able to use with Shape. For example:

This is a squeeze shape style with halo. Distance is 10.

How to use Gradient BrushStyle with Halo?

You need a little trick to use them together. Firstly, you might notice halo text has two parts, like the above figure, one is the foreground black text, another is the background yellow shadow. The yellow shadow will occupy some spaces, it will cause a little offset for the foreground text. For example, the position of the watermark is (2,50) in the above figure. If I write the text without halo, the foreground will exactly stay at (2,50). But after halo, the foreground text moves a little bit, because the whole portion will stay at (2,50) not just the foreground text.

So, what can we do if we want to write a text with halo but using Gradient brush style? The trick is that we can write the halo text first, then output a normal text with gradient color. But we need to assign a little offset to the position when overwriting the text. The offset is just the distance we set for halo effect. For example, in the below figure, the position of the normal text with gradient is (12, 60).

 

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