DrawingAttributes.Transparency - свойство
Обновлен: Ноябрь 2007
Gets or sets a value that indicates the transparency value of ink.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Property Transparency As Byte
'Применение
Dim instance As DrawingAttributes
Dim value As Byte
value = instance.Transparency
instance.Transparency = value
public byte Transparency { get; set; }
public:
property unsigned char Transparency {
unsigned char get ();
void set (unsigned char value);
}
/** @property */
public byte get_Transparency()
/** @property */
public void set_Transparency(byte value)
public function get Transparency () : byte
public function set Transparency (value : byte)
Значение свойства
Тип: System.Byte
A value that indicates the transparency value of ink.
Value |
Meaning |
---|---|
0 |
Default. The ink is totally opaque. |
0-255 |
The value for the transparency can range from totally opaque (0) to totally transparent (255). |
Заметки
Примечание. |
---|
The transparent rendering effect may be different between dynamic and static rendering. In dynamic rendering the Stroke object is rendered as it is drawn, as it is in the InkCollector.DynamicRendering property, for example. In static rendering, you use the Draw method of the Renderer object to render the Stroke object. |
Примеры
This C# example creates event handlers for menu items that change the Transparency property of a DrawingAttributes object.
using Microsoft.Ink;
//...
private System.Windows.Forms.MenuItem menuInkTransparencyOpaque;
private System.Windows.Forms.MenuItem menuInkTransparencyLight;
private InkCollector theInkCollector;
private System.Windows.Forms.MenuItem checkedTransparency;
//...
private void menuInkTransparencyOpaque_Click(
object sender, System.EventArgs e)
{
checkedTransparency.Checked = false;
// Set the transparency to opaque
theInkCollector.DefaultDrawingAttributes.Transparency = 0;
checkedTransparency = menuInkTransparencyOpaque;
checkedTransparency.Checked = true;
Refresh();
}
private void menuInkTransparencyLight_Click(
object sender, System.EventArgs e)
{
checkedTransparency.Checked = false;
// Set the transparency to about 90%
theInkCollector.DefaultDrawingAttributes.Transparency = 220;
checkedTransparency = menuInkTransparencyLight;
checkedTransparency.Checked = true;
Refresh();
}
This Microsoft® Visual Basic® .NET example creates event handlers for menu items that change the Transparency property of a DrawingAttributes object.
Imports Microsoft.Ink
'...
Dim MenuInkTransparencyOpaque As System.Windows.Forms.MenuItem
Dim MenuInkTransparencyLight As System.Windows.Forms.MenuItem
Dim CheckedTransparency As System.Windows.Forms.MenuItem
Dim theInkCollector As InkCollector
'...
Private Sub MenuInkTransparencyOpaque_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedTransparency.Checked = False
'Set the transparency to opaque
theInkCollector.DefaultDrawingAttributes.Transparency = 0
CheckedTransparency = MenuInkTransparencyOpaque
CheckedTransparency.Checked = True
Refresh()
End Sub
Private Sub MenuInkTransparencyLight_Click( _
ByVal sender As Object, ByVal e As System.EventArgs)
CheckedTransparency.Checked = False
'Set the transparency to about 90%
theInkCollector.DefaultDrawingAttributes.Transparency = 220
CheckedTransparency = MenuInkTransparencyLight
CheckedTransparency.Checked = True
Refresh()
End Sub
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0