当前位置: 首页>>代码示例>>C#>>正文


C# IGraphic类代码示例

本文整理汇总了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;
		}
开发者ID:CuriousX,项目名称:annotation-and-image-markup,代码行数:7,代码来源:AimGraphic.cs

示例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();
		}
开发者ID:nhannd,项目名称:Xian,代码行数:11,代码来源:ControlPointsGraphic.cs

示例3: AimGraphic

 public AimGraphic(IGraphic graphic, aim_dotnet.ImageAnnotation imageAnnotation, int shapeIdentifier)
     : base(graphic)
 {
     _imageAnnotation = imageAnnotation;
     _shapeIdentifier = shapeIdentifier;
     _graphic = graphic;
 }
开发者ID:CuriousX,项目名称:annotation-and-image-markup,代码行数:7,代码来源:AimGraphic.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:12,代码来源:BoundableResizeControlGraphic.cs

示例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;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:14,代码来源:ContextMenuControlGraphic.cs

示例6: SpatialTransform

		/// <summary>
		/// Initializes a new instance of <see cref="SpatialTransform"/>.
		/// </summary>
		public SpatialTransform(IGraphic ownerGraphic)
		{
			_ownerGraphic = ownerGraphic;
			_recalculationRequired = true;
			_updatingScaleParameters = false;
			Initialize();
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:10,代码来源:SpatialTransform.cs

示例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();
		}
开发者ID:nhannd,项目名称:Xian,代码行数:11,代码来源:TextPlaceholderControlGraphic.cs

示例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);
 }
开发者ID:HaKDMoDz,项目名称:tuesdays-are-fun,代码行数:7,代码来源:CardRenderWindow.xaml.cs

示例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;
		}
	}
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:34,代码来源:VRestrictedFlowLayout.cs

示例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));
				}
			}
		}
开发者ID:jasper-yeh,项目名称:ClearCanvas,代码行数:37,代码来源:MammographyImageSpatialTransform.cs

示例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;
 }
开发者ID:iS3-Project,项目名称:iS3,代码行数:7,代码来源:IS3Doc.cs

示例12: RemoveGraphicCommand

		public RemoveGraphicCommand(IGraphic graphic)
		{
			Platform.CheckForNullReference(graphic, "graphic");

			_graphic = graphic;
			Validate();
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:7,代码来源:RemoveGraphicUndoableCommand.cs

示例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;
        }
开发者ID:CuriousX,项目名称:annotation-and-image-markup,代码行数:35,代码来源:AimTemplateTreeGraphicsHelpers.cs

示例14: MainPresenter

        public MainPresenter(IGraphic graphic, IFileManager manager, IMessageService messageService)
        {
            _manager = manager;
            _messageService = messageService;
            _graphic = graphic;

            _graphic.FileOpenClick += _graphic_FileOpenClick;
        }
开发者ID:snowtrr,项目名称:EvaluationOfUncertainty,代码行数:8,代码来源:MainPresenter.cs

示例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);
			}
		}
开发者ID:nhannd,项目名称:Xian,代码行数:8,代码来源:InteractiveShutterGraphicBuilders.cs


注:本文中的IGraphic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。