本文整理汇总了C#中StrokeCollection.GetBounds方法的典型用法代码示例。如果您正苦于以下问题:C# StrokeCollection.GetBounds方法的具体用法?C# StrokeCollection.GetBounds怎么用?C# StrokeCollection.GetBounds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StrokeCollection
的用法示例。
在下文中一共展示了StrokeCollection.GetBounds方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Empty_GetBounds
public void Empty_GetBounds ()
{
StrokeCollection sc = new StrokeCollection ();
Assert.Throws<ArgumentException> (delegate {
sc.GetBounds ();
}, "GetBounds");
}
示例2: InkQueryRegionStruct
public InkQueryRegionStruct(StrokeCollection strokes)
{
_equalStrokes = strokes;
_children = new VisualCollection(this);
EqualRect = strokes.GetBounds();
LeftSideRegionRect = new Rect(new Point(EqualRect.TopLeft.X - EqualRect.Width * 5, EqualRect.TopLeft.Y - EqualRect.Height * 2), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
RightSideRegionRect = new Rect(new Point(EqualRect.BottomRight.X + EqualRect.Width, EqualRect.BottomRight.Y - EqualRect.Height * 3), new Size(EqualRect.Width * 4, EqualRect.Height * 4));
}
示例3: CheckOutputValue
private void CheckOutputValue(StrokeCollection myStrokes, String recognizedCharacter)
{
Rect rect = myStrokes.GetBounds();
SubCanvasEventArgs args;
switch(recognizedCharacter)
{
case "T":
args = new SubCanvasEventArgs(LogicCanvasType.TruthTable, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
case "e":
args = new SubCanvasEventArgs(LogicCanvasType.Expression, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
case "D":
args = new SubCanvasEventArgs(LogicCanvasType.Diagram, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
case "d":
args = new SubCanvasEventArgs(LogicCanvasType.Diagram, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
case "=":
args = new SubCanvasEventArgs(LogicCanvasType.EqualSign, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
case "?":
args = new SubCanvasEventArgs(LogicCanvasType.Question, rect, myStrokes);
OnSubCanvasGenerated(args);
break;
default:
break;
}
}
示例4: FreeDrawingMode
private void FreeDrawingMode(bool doEnter)
{
if (doEnter)
{
_ink.IsHitTestVisible = true;
_inkPalette.Visibility = Visibility.Visible;
_palette.Visibility = Visibility.Hidden;
//set drawing attributes of current palette owner
var da = _ink.DefaultDrawingAttributes.Clone();
da.Width = 4;
da.Height = 4;
_inkPalette.OnDrawingStarted();
da.Color = DaoUtils.UserIdToColor(_palette.GetOwnerId());
_ink.DefaultDrawingAttributes = da;
}
else
{
_ink.IsHitTestVisible = false;
_inkPalette.Visibility = Visibility.Hidden;
_palette.Visibility = Visibility.Visible;
_modeMgr.Mode = ShapeInputMode.ManipulationExpected;
//create free form shape if we have locally created strokes
var ownColor = DaoUtils.UserIdToColor(_palette.GetOwnerId());
//while we have been drawing, somebody else could draw and still hasn't finalized drawing, so ink canvas can contain
//strokes from multiple authors
var ownStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color == ownColor);
if (ownStrokes.Count() > 0)
{
//don't take cursor for free draw
var freeFrmSh =
(VdFreeForm) _doc.BeginCreateShape(VdShapeType.FreeForm, 0, 0, false, DocTools.TAG_UNDEFINED);
freeFrmSh.locallyJustCreated = true; //enable one-time stroke send
var ownStrokeCollection = new StrokeCollection(ownStrokes);
freeFrmSh.extractGeomtry(ownStrokeCollection, ownStrokeCollection.GetBounds());
//but set focus
_doc.VolatileCtx.UnfocusAll();
freeFrmSh.SetFocus();
//send state update to other clients
SendSyncState(freeFrmSh);
//remove own strokes
var notOwnStrokes = _ink.Strokes.Where(st => st.DrawingAttributes.Color != ownColor);
_ink.Strokes = new StrokeCollection(notOwnStrokes);
TryEndHostCaption(freeFrmSh, CaptionType.FreeDraw);
}
//update ink on other clients
sendLocalInk();
}
}