• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IGraphic类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IGraphic的典型用法代码示例。如果您正苦于以下问题:C# IGraphic类的具体用法?C# IGraphic怎么用?C# IGraphic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IGraphic类属于命名空间,在下文中一共展示了IGraphic类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GraphicWindow

        public GraphicWindow(string title, int x, int y, int width, int height)
			:base(title,x,y,width,height)
		{
			fActiveGraphic = null;
			//fMouseTrackerGraphic = null;
            fChildList = new List<IGraphic>();
            fLayoutManager = LayoutManager.Empty;
        }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:8,代码来源:GraphicWindow.cs


示例17: AddGraphicCommand

		public AddGraphicCommand(IGraphic graphic, GraphicCollection parentCollection)
		{
			Platform.CheckForNullReference(graphic, "graphic");
			Platform.CheckForNullReference(parentCollection, "parentCollection");

			_parentCollection = parentCollection;
			_graphic = graphic;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:8,代码来源:AddGraphicUndoableCommand.cs


示例18: TrackSlider

		//public event System.EventHandler ValueChangedEvent;

		public TrackSlider(string name, IGraphic track, IGraphic thumb,
						Orientation orient,
						float min, float max, 
						float initialValue)
			: base(name, 0,0,0,0)
		{
			fTrackGraphic = track;
			fThumbGraphic = thumb;
			fOrientation = orient;

			fMin = min;
			fMax = max;
			fCurrentValue = initialValue;
			fPosition = initialValue;

			int yoffset = 0;
			int xoffset = 0;
			int trackyoffset = 0;
			int trackxoffset = 0;
	
			if ((track==null) || (thumb==null))
				return ;
		
			AddGraphic(fTrackGraphic, null);
			AddGraphic(fThumbGraphic, null);

			if (orient == Orientation.Horizontal)
			{
				// Must align thumb vertically with track.
				int midy = fTrackGraphic.Frame.Top + (fTrackGraphic.Frame.Height+1)/2;
				int thumbHeight = fThumbGraphic.Frame.Height+1;
				yoffset = midy - (thumbHeight / 2);
				xoffset = fTrackGraphic.Frame.Left;
			} 
			else
			{
				// Must align thumb horizontally with track.
				int midx = Frame.Left+(Frame.Width+1)/2;
				int thumbWidth = fThumbGraphic.Frame.Width+1;
				int trackWidth = fTrackGraphic.Frame.Width+1;
				xoffset = midx - (thumbWidth / 2);
				yoffset = fTrackGraphic.Frame.Top;

				trackxoffset = midx - (trackWidth/2);
				trackyoffset = fTrackGraphic.Frame.Top;
		
				fTrackGraphic.MoveTo(trackxoffset, trackyoffset);
			}
	
			fThumbGraphic.MoveTo(xoffset,yoffset);
			RectangleI newFrame = fTrackGraphic.Frame;
			//newFrame.Union(fThumbGraphic.Frame);
			Frame = newFrame;

            SetValue(initialValue, false);
		}
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:58,代码来源:TrackSlider.cs


示例19: InsertGraphicCommand

		public InsertGraphicCommand(IGraphic graphic, GraphicCollection parentCollection, int index)
		{
			Platform.CheckForNullReference(graphic, "graphic");
			Platform.CheckForNullReference(parentCollection, "parentCollection");
			Platform.CheckTrue(index >= 0, "Insert index positive");

			_parentCollection = parentCollection;
			_graphic = graphic;
			_index = index;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:10,代码来源:InsertGraphicUndoableCommand.cs


示例20: MainMenu

 public MainMenu(IGraphic graphObject)
   : base(graphObject)
 {
   Buttons = new Dictionary<Button, ButtonParams>
               {
                 {
                   Button.NewGame, new ButtonParams
                                     {
                                       Image = Res.Buttons[Button.NewGame],
                                       Area = BuildButtonRect(Button.NewGame),
                                       Render = true
                                     }
                   },
                 {
                   Button.LoadGame, new ButtonParams
                                      {
                                        Image = Res.Buttons[Button.LoadGame],
                                        Area = BuildButtonRect(Button.LoadGame),
                                        Render = true
                                      }
                   },
                 {
                   Button.SmallScale, new ButtonParams
                                        {
                                          Image = Res.Buttons[Button.SmallScale],
                                          Area = BuildButtonRect(Button.SmallScale),
                                          Render = true
                                        }
                   },
                 {
                   Button.NormalScale, new ButtonParams
                                         {
                                           Image = Res.Buttons[Button.NormalScale],
                                           Area = BuildButtonRect(Button.NormalScale),
                                           Render = true
                                         }
                   },
                 {
                   Button.BigScale, new ButtonParams
                                      {
                                        Image = Res.Buttons[Button.BigScale],
                                        Area = BuildButtonRect(Button.BigScale),
                                        Render = true
                                      }
                   },
                 {
                   Button.Exit, new ButtonParams
                                  {
                                    Image = Res.Buttons[Button.Exit],
                                    Area = BuildButtonRect(Button.Exit),
                                    Render = true
                                  }
                   }
               };
 }
开发者ID:tupieurods,项目名称:tower-defense-csharp-opengl.gamelogic,代码行数:55,代码来源:MainMenu.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IGraphics类代码示例发布时间:2022-05-24
下一篇:
C# IGraphProcessingEnvironment类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap