D2DEffect
D2DEffect(CLSID)
Creates Direct2D effect.
Parameters
| Name | Type | Description |
|---|---|---|
CLSID | string | CLSID of Direct2D effect. See Effects for effects' CLSID. |
D2DEffect(CLSID)
Creates Direct2D effect.
| Name | Type | Description |
|---|---|---|
CLSID | string | CLSID of Direct2D effect. See Effects for effects' CLSID. |
CLSID: string = ""
CLSID of this effect.
Description: string
Description string for this effect.
InputCount: number
Get/Set input count for effect.
Name: string = ""
Human-readable name of effect.
GetPropertyType(index)
| Name | Type | Description |
|---|---|---|
index | number | Index of effect property. See Effects |
GetValue(index)
Gets effect property value by index.
| Name | Type | Description |
|---|---|---|
index | number | Index of input property. See Effects |
Object — Property value of corresponding type. See D2DEffectPropertyType
GetValueByName(name)
Gets effect property value by name.
| Name | Type | Description |
|---|---|---|
index | number | Index of input property. See Effects |
Object — Property value of corresponding type. See D2DEffectPropertyType
SetInput(index, bitmap, invalidate)
| Name | Type | Description |
|---|---|---|
index | number | Index of effect input |
bitmap | D2DBitmap | Input image |
invalidate = trueoptional | boolean | Whether to invalidate the graph at the location of the effect input |
window.DrawMode = 1;
include(`${fb.ComponentPath}\\docs\\Effects.js`);
const img = d2d.Image(`${fb.ComponentPath}\\samples\\d2d\\images\\Flowers.jpg`);
const effect = d2d.Effect(Effects.Sepia.ID);
effect.SetInput(0, img);
effect.SetValue(Effects.Sepia.Intensity, 0.5);
function on_paint(dgr) {
dgr.DrawEffect(effect, 10, 10, 0, 0, img.Width, img.Height);
}
SetInputEffect(index, effect, invalidate)
| Name | Type | Description |
|---|---|---|
index | number | Index of effect input |
effect | D2DEffect | Input effect |
invalidate = trueoptional | boolean | Whether to invalidate the graph at the location of the effect input |
window.DrawMode = 1;
include(`${fb.ComponentPath}\\docs\\Effects.js`);
const img = d2d.Image(`${fb.ComponentPath}\\samples\\d2d\\images\\Flowers.jpg`);
const sepia = d2d.Effect(Effects.Sepia.ID);
sepia.SetInput(0, img);
sepia.SetValue(Effects.Sepia.Intensity, 0.5);
const contrast = d2d.Effect(Effects.Contrast.ID);
contrast.SetInputEffect(0, sepia);
contrast.SetValue(Effects.Contrast.Contrast, 1.0);
const scale = d2d.Effect(Effects.Scale.ID);
scale.SetInputEffect(0, contrast);
scale.SetValue(Effects.Scale.Scale, [0.7, 0.7]);
function on_paint(dgr) {
dgr.DrawEffect(scale, 10, 10, 0, 0, img.Width, img.Height);
}
SetValue(index, value)
Sets the corresponding property by index.
| Name | Type | Description |
|---|---|---|
index | number | Index of input property. See Effects |
value | Object | Property value of corresponding type. See D2DEffectPropertyType |
SetValueByName(name, value)
Sets the corresponding property by name.
| Name | Type | Description |
|---|---|---|
name | string | Index of input property. See Effects |
value | Object | Property value of corresponding type. See D2DEffectPropertyType |