本文整理汇总了C#中IGraphic类的典型用法代码示例。如果您正苦于以下问题:C# IGraphic类的具体用法?C# IGraphic怎么用?C# IGraphic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGraphic类属于命名空间,在下文中一共展示了IGraphic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AimGraphic
public AimGraphic(IGraphic graphic, IAimAnnotationInstance annotationInstance, int shapeIdentifier)
: base(graphic)
{
_annotationInstance = annotationInstance;
_shapeIdentifier = shapeIdentifier;
_graphic = graphic;
}
示例2: ControlPointsGraphic
/// <summary>
/// Constructs a new <see cref="ControlPointsGraphic"/> to control the given subject graphic.
/// </summary>
/// <param name="subject">The graphic to control.</param>
public ControlPointsGraphic(IGraphic subject)
: base(subject)
{
_stretchingToken = new CursorToken(CursorToken.SystemCursors.Cross);
Initialize();
}
示例3: AimGraphic
public AimGraphic(IGraphic graphic, aim_dotnet.ImageAnnotation imageAnnotation, int shapeIdentifier)
: base(graphic)
{
_imageAnnotation = imageAnnotation;
_shapeIdentifier = shapeIdentifier;
_graphic = graphic;
}
示例4: BoundableResizeControlGraphic
/// <summary>
/// Constructs a new <see cref="BoundableResizeControlGraphic"/>.
/// </summary>
/// <param name="fixedAspectRatio">The width to height aspect ratio that constrains the movement of the resize control points, or null if the movement should not be constrained.</param>
/// <param name="subject">An <see cref="IBoundableGraphic"/> or an <see cref="IControlGraphic"/> chain whose subject is an <see cref="IBoundableGraphic"/>.</param>
public BoundableResizeControlGraphic(float? fixedAspectRatio, IGraphic subject)
: this(subject)
{
if (fixedAspectRatio.HasValue)
Platform.CheckPositive(fixedAspectRatio.Value, "fixedAspectRatio");
_fixedAspectRatio = fixedAspectRatio;
}
示例5: ContextMenuControlGraphic
/// <summary>
/// Constructs an instance of a <see cref="ContextMenuControlGraphic"/> with the specified initial context menu actions.
/// </summary>
/// <param name="namespace">The namespace to qualify the <paramref name="site"/>.</param>
/// <param name="site">The action model site for the context menu (see <see cref="ActionPath.Site"/>).</param>
/// <param name="actions">The set of actions on the context menu.</param>
/// <param name="subject">The subject graphic.</param>
public ContextMenuControlGraphic(string @namespace, string site, IActionSet actions, IGraphic subject)
: base(subject)
{
_namespace = @namespace;
_site = site;
_actions = actions;
}
示例6: SpatialTransform
/// <summary>
/// Initializes a new instance of <see cref="SpatialTransform"/>.
/// </summary>
public SpatialTransform(IGraphic ownerGraphic)
{
_ownerGraphic = ownerGraphic;
_recalculationRequired = true;
_updatingScaleParameters = false;
Initialize();
}
示例7: TextPlaceholderControlGraphic
/// <summary>
/// Constructs a new <see cref="TextPlaceholderControlGraphic"/>.
/// </summary>
/// <param name="subject">An <see cref="ITextGraphic"/> or an <see cref="IControlGraphic"/> chain whose subject is an <see cref="ITextGraphic"/>.</param>
public TextPlaceholderControlGraphic(IGraphic subject)
: base(subject)
{
Platform.CheckExpectedType(base.Subject, typeof (ITextGraphic));
Initialize();
}
示例8: RenderImage
public void RenderImage(IGraphic img, Vector2 pos)
{
Image ui = img.MakeImage();
RenderCanvas.Children.Add(ui);
Canvas.SetLeft(ui, pos.X);
Canvas.SetTop(ui, pos.Y);
}
示例9: AddToLayout
public override void AddToLayout(IGraphic trans)
{
int cWidth = Frame.Width;
int cHeight = Frame.Height;
int left = 0; // WAA - Container.Origin.X;
int numElements = Container.CountGraphics();
int fixedHeight = (cHeight - ((numElements - 1) * fGap)) / (numElements);
int collectiveHeight=0;
bool normalize = false;
// First figure out the collective height
foreach (IGraphic g in Container.GraphicChildren)
collectiveHeight += g.Frame.Height;
collectiveHeight += fGap * (numElements - 1);
if (collectiveHeight > cHeight)
normalize = true;
int currentY = 0; // WAA - Container.Origin.Y;
foreach (IGraphic g in Container.GraphicChildren)
{
if (normalize)
{
g.ResizeTo(cWidth, fixedHeight);
} else
{
g.ResizeTo(cWidth, g.Frame.Height);
}
g.MoveTo(left + fMargin, currentY);
currentY = g.Frame.Bottom + fGap;
}
}
示例10: MammographyImageSpatialTransform
/// <summary>
/// Initializes a new instance of <see cref="MammographyImageSpatialTransform"/> with the specified image plane details.
/// </summary>
public MammographyImageSpatialTransform(IGraphic ownerGraphic, int rows, int columns, double pixelSpacingX, double pixelSpacingY, double pixelAspectRatioX, double pixelAspectRatioY, PatientOrientation patientOrientation, string laterality)
: base(ownerGraphic, rows, columns, pixelSpacingX, pixelSpacingY, pixelAspectRatioX, pixelAspectRatioY)
{
// image coordinates are defined with X and Y being equivalent to the screen axes (right and down) and with Z = X cross Y (into the screen)
Vector3D imagePosterior, imageHead, imageLeft; // patient orientation vectors in image space
GetPatientOrientationVectors(patientOrientation, out imageHead, out imageLeft, out imagePosterior);
// no adjustments if the posterior direction is not represented in the image
if ((_imagePosterior = imagePosterior) != null)
{
Vector3D normativePosterior, normativeHead, normativeLeft; // normative patient orientation vectors in image space
GetNormativeOrientationVectors(laterality, out normativeHead, out normativeLeft, out normativePosterior);
// only do any adjustments if laterality implies a normative orientation for the posterior direction
if (normativePosterior != null)
{
// check if the order of the patient vectors are flipped according to the normative vectors
// we know we need to flip if the direction vector cross products have different signs
if (imageHead != null)
FlipX = _coreFlipX = Math.Sign(imagePosterior.Cross(imageHead).Z) != Math.Sign(normativePosterior.Cross(normativeHead).Z);
else if (imageLeft != null)
FlipX = _coreFlipX = Math.Sign(imagePosterior.Cross(imageLeft).Z) != Math.Sign(normativePosterior.Cross(normativeLeft).Z);
// with flip normalized, just rotate to align the current posterior direction with the normative posterior
var currentPosterior = GetCurrentPosteriorVector(_imagePosterior, SourceWidth, AdjustedSourceHeight, 0, 1, 1, _coreFlipX, false);
var posteriorAngle = Math.Atan2(currentPosterior.Y, currentPosterior.X);
var normativeAngle = Math.Atan2(normativePosterior.Y, normativePosterior.X);
// compute required rotation, rounded to multiples of 90 degrees (PI/2 radians)
RotationXY = _coreRotation = 90*((int) Math.Round((normativeAngle - posteriorAngle)*2/Math.PI));
}
}
}
示例11: GraphicToXml
public static XElement GraphicToXml(IGraphic g)
{
XElement node = new XElement("IS3Graphic",
new XAttribute("DGObjID", g.DGObjID.ToString()),
new XAttribute("Geometry",g.Geometry.ToJson()));
return node;
}
示例12: RemoveGraphicCommand
public RemoveGraphicCommand(IGraphic graphic)
{
Platform.CheckForNullReference(graphic, "graphic");
_graphic = graphic;
Validate();
}
示例13: GraphicToIMarkup
internal static IMarkup GraphicToIMarkup(IGraphic graphic)
{
if (graphic == null || graphic.ParentPresentationImage == null)
return null;
var markup = DoGraphicToIMarkup(graphic);
if (markup != null)
{
var sopInstanceUid = string.Empty;
var frameNumber = 1;
try
{
if (graphic.ParentPresentationImage is IImageSopProvider)
{
var imageSopProvider = graphic.ParentPresentationImage as IImageSopProvider;
sopInstanceUid = imageSopProvider.ImageSop.SopInstanceUid;
frameNumber = imageSopProvider.Frame.FrameNumber;
}
else if (!string.IsNullOrEmpty(graphic.ParentPresentationImage.Uid))
sopInstanceUid = graphic.ParentPresentationImage.Uid;
}
catch (Exception)
{
}
markup.PresentationImageUid = sopInstanceUid;
markup.FrameNumber = frameNumber;
markup.IncludeInAnnotation = true;
markup.GraphicHashcode = graphic.GetHashCode();
}
return markup;
}
示例14: MainPresenter
public MainPresenter(IGraphic graphic, IFileManager manager, IMessageService messageService)
{
_manager = manager;
_messageService = messageService;
_graphic = graphic;
_graphic.FileOpenClick += _graphic_FileOpenClick;
}
示例15: Flash
private static void Flash(IGraphic graphic)
{
if (graphic is IVectorGraphic)
{
DoFlashDelegate doFlashDelegate = DoFlash;
doFlashDelegate.BeginInvoke((IVectorGraphic) graphic, SynchronizationContext.Current, delegate(IAsyncResult result) { doFlashDelegate.EndInvoke(result); }, null);
}
}