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


C# IImage类代码示例

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


IImage类属于命名空间,在下文中一共展示了IImage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateInput

 public static ProcessorResult CreateInput(IProcessor pro, IImage src)
 {
     ProcessorResult r = new ProcessorResult();
     r.Result = src == null ? null : src.ToBitmap();
     r.Name = "输入图像";
     return r;
 }
开发者ID:493409332,项目名称:smartimage,代码行数:7,代码来源:IResult.cs

示例2: ConvertIntToFloat

        public static unsafe void ConvertIntToFloat(IImage src, IImage dest)
        {
            int nChannels = src.ColorInfo.NumberOfChannels;
            int elemWidth = src.Width * nChannels;
            int height = src.Height;

            int srcStride = src.Stride;
            int destStride = dest.Stride;

            for (int channel = 0; channel < src.ColorInfo.NumberOfChannels; channel++)
            {
                int* srcPtr = (int*)src.ImageData + channel;
                float* destPtr = (float*)dest.ImageData + channel;

                for (int r = 0; r < height; r++)
                {
                    for (int c = 0; c < elemWidth; c += nChannels)
                    {
                        destPtr[c] = srcPtr[c];
                    }

                    srcPtr += srcStride / sizeof(int);
                    destPtr += destStride / sizeof(float);
                }
            }
        }
开发者ID:remingtonsteel,项目名称:accord-net-extensions,代码行数:26,代码来源:FromIntDepthConverters.cs

示例3: Show

 /// <summary>
 /// Display the histograms of the specific image
 /// </summary>
 /// <param name="image">The image to retrieve hostigram from</param>
 /// <param name="numberOfBins">The numebr of bins in the histogram</param>
 public static void Show(IImage image, int numberOfBins)
 {
     HistogramViewer viewer = new HistogramViewer();
      viewer.HistogramCtrl.GenerateHistograms(image, numberOfBins);
      viewer.HistogramCtrl.Refresh();
      viewer.Show();
 }
开发者ID:TaNeRs,项目名称:SSSS,代码行数:12,代码来源:HistogramViewer.cs

示例4: SavedTreeNode

		public SavedTreeNode(IImage image, string fullname, string text)
			: base(null)
		{
			base.IconImage = image;
			FullName = fullname;
			Text = text;
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:7,代码来源:SavedTreeNode.cs

示例5: SetImage

        public void SetImage(IImage image)
        {
            #region display the size of the image
             Size size = image.Size;
             widthTextbox.Text = size.Width.ToString();
             heightTextBox.Text = size.Height.ToString();
             #endregion

             #region display the color type of the image
             Type colorType = Reflection.ReflectIImage.GetTypeOfColor(image);
             Object[] colorAttributes = colorType.GetCustomAttributes(typeof(ColorInfoAttribute), true);
             if (colorAttributes.Length > 0)
             {
            ColorInfoAttribute info = (ColorInfoAttribute)colorAttributes[0];
            typeOfColorTexbox.Text = info.ConversionCodename;
             }
             else
             {
            typeOfColorTexbox.Text = Properties.StringTable.Unknown;
             }

             Type colorDepth = Reflection.ReflectIImage.GetTypeOfDepth(image);
             typeOfDepthTextBox.Text = colorDepth.Name;
             #endregion

             UpdateHistogram();
             UpdateZoomScale();
        }
开发者ID:samuto,项目名称:UnityOpenCV,代码行数:28,代码来源:ImageProperty.cs

示例6: Start

		public override void Start()
		{
			base.Start();

			IStack stack = Platform.Current.Create<IStack>();

			ILabel lblLabel = Platform.Current.Create<ILabel>();
			lblLabel.Text = "View an image from Url";
			lblLabel.Height = 30;
			stack.Children.Add(lblLabel);

			IImageButton imgbtn = Platform.Current.Create<IImageButton>();
			imgbtn.LoadFromUrl(new Uri("http://okhosting.com/wp-content/uploads/2016/02/okhosting-150x150.png"));
			imgbtn.Height = 100;
			imgbtn.Width = 100;
			imgbtn.Click += CmdViewImage_Click;
			stack.Children.Add(imgbtn);

			imgPicture = Platform.Current.Create<IImage>();
			imgPicture.LoadFromUrl(new Uri("http://www.patycantu.com/wp-content/uploads/2014/07/91.jpg"));
			imgPicture.Height = 250;
			imgPicture.Width = 600;
			imgPicture.Visible = false;
			stack.Children.Add(imgPicture);

			IButton cmdClose = Platform.Current.Create<IButton>();
			cmdClose.Text = "Close";
			cmdClose.Click += CmdClose_Click;
			stack.Children.Add(cmdClose);

			Platform.Current.Page.Title = "Test label";
			Platform.Current.Page.Content = stack;
		}
开发者ID:okhosting,项目名称:OKHOSTING.UI,代码行数:33,代码来源:ImageButtonController.cs

示例7: HandleCore

        protected override IImage HandleCore(IImage src)
        {
            throw new NotImplementedException();
            //IImage dst = null;
            //if (src.PixelFormat == System.Drawing.Imaging.PixelFormat.Format8bppIndexed)
            //{
            //    m_filter = new HoughLineTransformation();

            //    if (StepsPerDegree > 10) StepsPerDegree = 10;
            //    else if (StepsPerDegree < 1) StepsPerDegree = 1;

            //    if (LocalPeakRadius > 10) LocalPeakRadius = 10;
            //    else if (LocalPeakRadius < 1) LocalPeakRadius = 1;

            //    m_filter.StepsPerDegree = this.StepsPerDegree;
            //    m_filter.LocalPeakRadius = this.LocalPeakRadius;

            //    m_filter.ProcessImage(src);
            //    WriteHoughLine();
            //    dst = m_filter.ToBitmap();
            //}
            //else
            //{
            //    dst = src.Clone() as Bitmap;
            //}
            //IImage dst;
        }
开发者ID:493409332,项目名称:smartimage,代码行数:27,代码来源:SimpleHoughLineProcessor.cs

示例8: Save

 public void Save(IImage image, IFile file)
 {
     var actual = ((ImageAdapter)image).Image;
     using (var stream = file.Open(FileLockMode.ReadWrite, FileOpenMode.Recreate)) {
         actual.Save(stream, this.codec, this.parameters);
     }
 }
开发者ID:ashmind,项目名称:gallery,代码行数:7,代码来源:ImageCodecAdapter.cs

示例9: Handle

        public IImage Handle(IImage src)
        {
            m_cacheResults.Clear();
            if (src == null) return null;

            if (Enable == true)
            {
                try
                {
                    this.m_inputImage = src;
                    this.m_cacheResults.Add(this.CreateInput(this.m_inputImage));
                    this.m_outputImage = this.HandleCore(src);
                    if (this.m_outputImage != null)
                    {
                        this.m_cacheResults.Add(this.CreateOutput(this.m_outputImage));
                    }
                    return this.m_outputImage;
                }
                catch (Exception ex)
                {
                    this.m_cacheResults.Add(this.CreateExceptionResult(ex));
                    return this.m_outputImage;
                }
                finally
                {
                }
            }
            else return src;
        }
开发者ID:493409332,项目名称:smartimage,代码行数:29,代码来源:BaseProcessor.cs

示例10: HandleCore

 protected override IImage HandleCore(IImage src)
 {
     // Bitmap dst = src.Clone(new Rectangle(0,0,src.Width,src.Height), src.PixelFormat) as Bitmap;
     //			m_filter.ApplyInPlace(dst);
     // return dst;
     throw new NotImplementedException();
 }
开发者ID:493409332,项目名称:smartimage,代码行数:7,代码来源:MedianFilter.cs

示例11: ConvertByteToDouble

        public static unsafe void ConvertByteToDouble(IImage src, IImage dest)
        {
            int nChannels = src.ColorInfo.NumberOfChannels;
            int elemWidth = src.Width * nChannels;
            int height = src.Height;

            int srcStride = src.Stride;
            int destStride = dest.Stride;

            for (int channel = 0; channel < src.ColorInfo.NumberOfChannels; channel++)
            {
                byte* srcPtr = (byte*)src.ImageData + channel;
                double* destPtr = (double*)dest.ImageData + channel;

                for (int r = 0; r < height; r++)
                {
                    for (int c = 0; c < elemWidth; c += nChannels)
                    {
                        destPtr[c] = srcPtr[c];
                    }

                    srcPtr += srcStride / sizeof(byte);
                    destPtr += destStride / sizeof(double);
                }
            }
        }
开发者ID:remingtonsteel,项目名称:accord-net-extensions,代码行数:26,代码来源:FromByteDepthConverters.cs

示例12: Recognize

 public int Recognize(IImage image)
 {
     var discretizedImage = discretizer.Discretize(image);
     var activeNeuron = classifier.Classify(discretizedImage);
     var cluster = mapper.Map(activeNeuron);
     return cluster;
 }
开发者ID:forkbomb,项目名称:pikto,代码行数:7,代码来源:RecognitionPath.cs

示例13: getDefaultSprite

		private static ISprite getDefaultSprite(IImage image, IGraphicsFactory factory)
		{
			ISprite sprite = factory.GetSprite();
			sprite.Image = image;
			sprite.Location = AGSLocation.Empty();
			return sprite;
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSSingleFrameAnimation.cs

示例14: CreateOutput

 public static ProcessorResult CreateOutput(IProcessor pro, IImage output)
 {
     ProcessorResult r = new ProcessorResult();
     r.Result = output == null ? null : output.ToBitmap();
     r.Name = "输出图像";
     return r;
 }
开发者ID:493409332,项目名称:smartimage,代码行数:7,代码来源:IResult.cs

示例15: DrawImage

		public void DrawImage (IImage image, Rect frame, double alpha = 1.0)
		{
			var ch = GetChild (ChildType.Image);
			var s = (Shapes.Rectangle)ch.Shape;
			s.Width = frame.Width;
			s.Height = frame.Height;
		}
开发者ID:michaelstonis,项目名称:NGraphics,代码行数:7,代码来源:CanvasCanvas.cs


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