Glowfilter-luminous Filter

Source: Internet
Author: User
Sorry, this filter will not surprise you. glowfilter is just created and placed. Light effect. Specifically, it is creating luminous color fills with different transparency around the component (however, this name is too long ). Its attribute is actually dropshadow. A subset of filters. Its constructor is as follows:
Glowfilter (
Color: uint = 16711680,
ALPHA: Number = 1,
Blurx: Number = 6,
Blury: Number = 6,
Strength: Number = 2,
Quality: Int = 1,
Inner: Boolean = false,
Knockout: Boolean = false

)

Parameters

Color: (default = 0xff0000)-halo color, in hexadecimal format 0xRrggbb. The default value is 0xff0000.
 
ALPHA: (default = 1.0)-the Alpha transparency of the color. Valid values: 0 to 1. For example,. 25 sets the transparency value to 25%.
 
Blurx: (default = 6.0)-horizontal blur. Valid values: 0 to 255 (floating point ). The multiplier values (such as 2, 4, 8, 16, and 32) of 2 are optimized to display faster than other values.
 
Blury: (default = 6.0)-vertical blur. Valid values: 0 to 255 (floating point ). The multiplier values (such as 2, 4, 8, 16, and 32) of 2 are optimized to display faster than other values.
 
Strength: (default = 2)-imprint or cross-page strength. The higher the value, the deeper the color of the impression, and the stronger the contrast between the light and the background. Valid values: 0 to 255.
 
Quality: (default = 1)-number of times the filter is applied. Use bitmapfilterquality constant:

  • Bitmapfilterquality. Low
  • Bitmapfilterquality. Medium
  • Bitmapfilterquality. High

For more information, see the description of the quality attribute.

 
Inner: (default = false)-specifies whether the light emitting is inner. The value true indicates that the inside side of the light emits. The value "false" indicates that the light emitting is the outside light (the light emitting around the outer edge of the object ).
 
Knockout: (default = false)-specifies whether the object has a hollowing effect. If the value is true, the filling of the object is transparent and the background color of the document is displayed.

The biggest difference between it and dropshadowfilter is that distance and angle cannot be set. That is to say, the luminous effect always follows the edge of the object.(It can also be interpreted that the luminous effect is the projection filter where distance is set to 0 and the non-angular parameter is always projected along the edge ).
You can use glowfilter to plot the luminous effect along the edge. It is mainly used to add the mouse slide effect for interactive buttons.Adding inner light for text to highlight it in the background image; adding light to the contour edge of the Silhouette ImageBorder. In the usage of glowfilter, I like to add solid color outlines for objects. Set blurx and blury to 2, increase the intensity of strength, and then adjust the width of the contour line through the set value of quality. 2-19.

Figure 2-19. Apply the glowfilter rectangular shape and add the contour effect to the text
Package {

Import flash. Filters. bitmapfilterquality;
Import flash. Filters. glowfilter;
Import flash. Text. textfield;
Import flash. Text. textformat;
Import flash. Text. textformatalign;

[SWF (width = 550, Height = 400, backgroundcolor = 0 xeeeeee)]


Public class glowfiltertest extends bitmapfiltertest {


override protected function applyfilter (): void {
var filter: glowfilter = new glowfilter (0x000000);
filter. blurx = 2;
filter. blury = 2;
filter. strength = 255;
filter. quality = bitmapfilterquality. medium;
filter. knockout = true;
_ shape. filters = [filter];

// Creates a textfield to which to apply a glow
VaR field: textfield = new textfield ();
VaR textformat: textformat = new textformat ("Arial", 40 );
Textformat. align = textformatalign. Center;
Field. multiline = true;
Field. defaulttextformat = textformat;
Field. Text = "Glow \ nfilter ";
Field. x = _ shape. X-field. width/2;
Field. Y = _ shape. Y-field. Height/2;
Field. Filters = [filter];
Addchild (field );
}

}

}This class inherits bitmapfilterteThe St class is applied to the _ shape object at the same time, and the textfield object is added to better display the filter effect. The Blur intensity of the filter is very small, and the intensity is very large. At the same time, the knockout attribute is set to remove the original fill color and apply it to the _ shape and textfield objects to demonstrate the effect of the contour.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.