InkOverlay.AutoRedraw - свойство
Обновлен: Ноябрь 2007
Gets or sets a value that specifies whether the InkOverlay object repaints the ink when the window is invalidated.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
<BrowsableAttribute(True)> _
Public Property AutoRedraw As Boolean
'Применение
Dim instance As InkOverlay
Dim value As Boolean
value = instance.AutoRedraw
instance.AutoRedraw = value
[BrowsableAttribute(true)]
public bool AutoRedraw { get; set; }
[BrowsableAttribute(true)]
public:
property bool AutoRedraw {
bool get ();
void set (bool value);
}
/** @property */
/** @attribute BrowsableAttribute(true) */
public boolean get_AutoRedraw()
/** @property */
/** @attribute BrowsableAttribute(true) */
public void set_AutoRedraw(boolean value)
public function get AutoRedraw () : boolean
public function set AutoRedraw (value : boolean)
Значение свойства
Тип: System.Boolean
Value that specifies whether the InkOverlay object repaints the ink when the window is invalidated.
true if the InkOverlay object repaints the ink when the window is invalidated; otherwise, false.
Заметки
The value for AutoRedraw specifies whether or not the Ink object currently associated with InkOverlay object is automatically redrawn when the window associated with the InkOverlay object receives a Paint notification. For example, if set to true, when you minimize the window and then restore it, the ink is automatically redrawn. If set to false, when you minimize the window and then restore it, the ink disappears from view.
When AutoRedraw is false, the ink appears while inking unless the DynamicRendering property is false.
When your application is performing custom rendering or when your application is sensitive to painting issues, you can handle the repainting yourself and set the AutoRedraw property to false for the InkOverlay object. In that case add a delegate to the InkOverlay object's OnPainted event handler to draw the ink yourself or handle the underlying control's Invalidate event to modify the InvalidateEventArgs object.
Примеры
This example displays strokes in an InkOverlay object by setting the AutoRedraw property to false, then manually drawing the ink. The Paint event handler for the control to which the InkCollector is attached checks the size of each stroke. If the stroke is smaller than 400 ink space units, the stroke appears blue.
Private Sub mInkObjectControl_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
' Check if AutoRedraw is off
' mInkObject can be InkCollector, InkOverlay, or InkPicture
If Not mInkObject.AutoRedraw Then
' Draw each stroke manually
For Each stroke As Stroke In mInkObject.Ink.Strokes
' See if this stroke is small
Dim strokeBounds As Rectangle = stroke.GetBoundingBox()
If strokeBounds.Width < 400 And strokeBounds.Height < 400 Then
' Change the drawing color to blue
Dim newAttributes As DrawingAttributes = stroke.DrawingAttributes.Clone()
newAttributes.Color = Color.Blue
' Draw with these special drawing attributes
mInkObject.Renderer.Draw(e.Graphics, stroke, newAttributes)
Else
' Draw stroke with its own drawing attributes
mInkObject.Renderer.Draw(e.Graphics, stroke)
End If
Next
End If
End Sub
private void mInkObjectControl_Paint(object sender, PaintEventArgs e)
{
// Check if AutoRedraw is off
// mInkObject can be InkCollector, InkOverlay, or InkPicture
if (!mInkObject.AutoRedraw)
{
// Draw each stroke manually
foreach (Stroke stroke in mInkObject.Ink.Strokes)
{
// See if this stroke is small
Rectangle strokeBounds = stroke.GetBoundingBox();
if (strokeBounds.Width < 400 && strokeBounds.Height < 400)
{
// Change the drawing color to blue
DrawingAttributes newAttributes = stroke.DrawingAttributes.Clone();
newAttributes.Color = Color.Blue;
// Draw with these special drawing attributes
mInkObject.Renderer.Draw(e.Graphics, stroke, newAttributes);
}
else
{
// Draw stroke with its own drawing attributes
mInkObject.Renderer.Draw(e.Graphics, stroke);
}
}
}
}
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0