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


C# Drawing.Image类代码示例

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


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

示例1: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ColorMatrixManager.Contrast(Value).Apply(img);
     }
 }
开发者ID:BallisticLingonberries,项目名称:ShareX,代码行数:7,代码来源:Contrast.cs

示例2: ScrollBarThumb

        public ScrollBarThumb(ScrollBarThumbDefaults type)
        {
            this._imageAttributes = new ImageAttributes();
            this._imageAttributes.ClearColorKey();
            this._gripImageAttributes = new ImageAttributes();
            this._gripImageAttributes.ClearColorKey();
            switch (type)
            {
                case ScrollBarThumbDefaults.Normal:
                    this._color = SystemColors.ScrollBar;
                    this._gripColor = SystemColors.ControlText;
                    break;

                case ScrollBarThumbDefaults.Highlight:
                    this._color = SystemColors.ControlText;
                    this._gripColor = SystemColors.HighlightText;
                    break;
            }
            this._borderStyle = ScrollBarBorderStyle.Solid;
            this._borderColor = SystemColors.ControlText;
            this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal);
            this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged);
            this._image = null;
            this._imageLayout = ScrollBarThumbImageLayout.Stretch;
            this._imageTransparentColor = System.Drawing.Color.Transparent;
            this._gripStyle = ScrollBarThumbGripStyle.Lines;
            this._gripImage = null;
            this._gripImageTransparentColor = System.Drawing.Color.Transparent;
            this._gripLines = 3;
        }
开发者ID:north0808,项目名称:haina,代码行数:30,代码来源:ScrollBarThumb.cs

示例3: AojPrintPropertySystem

 protected AojPrintPropertySystem(AojPrintPropertySystem propertySystem)
 {
     lock (new object())
     {
         this._id = propertySystem.Id;
         this._x = propertySystem.X;
         this._y = propertySystem.Y;
         this._realX = propertySystem.RealX;
         this._realY = propertySystem.RealY;
         this._width = propertySystem.Width;
         this._height = propertySystem.Height;
         this._backgroundColor = propertySystem.BackgroundColor;
         this._backgroundShape = propertySystem.BackgroundShape;
         this._backgroundStyle = propertySystem.BackgroundStyle;
         this._borderColor = propertySystem.BorderColor;
         this._borderStyle = propertySystem.BorderStyle;
         this._borderWidth = propertySystem.BorderWidth;
         this._fontColor = propertySystem.FontColor;
         this._fontDisplayFormat = propertySystem.FontDisplayFormat;
         this._fontFamilyName = propertySystem.FontFamilyName;
         this._fontSize = propertySystem.FontSize;
         this._fontStyle = propertySystem.FontStyle;
         this._src = propertySystem.Src;
         this._imgPrint = propertySystem.ImgPrint;
         this._imageMode = propertySystem.ImageMode;
         this._alignment = propertySystem.Alignment;
         this._value = propertySystem.Value;
         this._viewFormat = propertySystem._viewFormat;
     }
 }
开发者ID:JosonYang,项目名称:aojreporter,代码行数:30,代码来源:AojPrintPropertySystem.cs

示例4: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ColorMatrixManager.ChangeGamma(img, Value);
     }
 }
开发者ID:barsv,项目名称:ShareX,代码行数:7,代码来源:Gamma.cs

示例5: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ColorMatrixManager.Grayscale(Value).Apply(img);
     }
 }
开发者ID:Maximus325,项目名称:ShareX,代码行数:7,代码来源:Grayscale.cs

示例6: DStarLiteForm

 public DStarLiteForm()
 {
     InitializeComponent();
     My_D_Star_Lite = new D_Star_Lite();
     My_D_Star_Lite.Initial(Map_column, Map_row);
     New_Obstacle_List = new ArrayList();
     Team_List = new ArrayList();
     Alliance_List = new ArrayList();
     Enemy_list = new ArrayList();
     Get_Path = new ArrayList();
     Obstacle_List = new ArrayList();
     Updated_Nodes = new ArrayList();
     Path = new ArrayList();
     Map_Graphic = this.CreateGraphics();
     Re_Open_Nodes = Properties.Resources.Circle;
     Closed_Nodes = Properties.Resources.Circle_Cross;
     Robot = Properties.Resources.Robot1;
     New_Obs = Properties.Resources.RectangleWithCross;
     Path_Node = Properties.Resources.Empty_Rec;
     Round_Obstacle = Properties.Resources.Round;
     Triangle_Obstacle = Properties.Resources.Triangle;
     Target = Properties.Resources._5edge_Star;
     Rect_Obstacle = Properties.Resources.Rec_Obs;
     //mymap = new Grid_Map(Map_column, Map_row, 0, 0, Map_Graphic);
     Map_Background = Properties.Resources.Background;
     Map_Graphic.DrawImage(Map_Background, new Point(0, 0));
     Move_Button.Enabled = false;
 }
开发者ID:teamEIT,项目名称:MobileRobotProject,代码行数:28,代码来源:DStarLiteForm.cs

示例7: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ColorMatrixManager.Polaroid().Apply(img);
     }
 }
开发者ID:TreeSeed,项目名称:ShareX,代码行数:7,代码来源:Polaroid.cs

示例8: ImageToByteArray

 public byte[] ImageToByteArray(Image imageIn, string imageFormatString)
 {
     var ms = new MemoryStream();
     var imageFormat = getImageFormat(imageFormatString);
     imageIn.Save(ms, imageFormat);
     return ms.ToArray();
 }
开发者ID:petermunnings,项目名称:funwithoiky,代码行数:7,代码来源:PhotoServices.cs

示例9: Resize

        public static Image Resize(Image source, Size size)
        {
            int width = source.Width;
            int height = source.Height;

            float num3 = 0f;
            float num4 = 0f;
            float num5 = 0f;

            num4 = ((float)size.Width) / ((float)width);
            num5 = ((float)size.Height) / ((float)height);

            if (num5 < num4)
            {
                num3 = num5;
            }
            else
            {
                num3 = num4;
            }

            int num6 = (int)(width * num3);
            int num7 = (int)(height * num3);

            Bitmap image = new Bitmap(num6, num7);

            using (Graphics graphics = Graphics.FromImage(image))
            {
                graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                graphics.DrawImage(source, 0, 0, num6, num7);
            }

            return image;
        }
开发者ID:btungut,项目名称:Cruder.Net,代码行数:34,代码来源:ImageHelper.cs

示例10: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ColorMatrixManager.BlackWhite().Apply(img);
     }
 }
开发者ID:KamilKZ,项目名称:ShareX,代码行数:7,代码来源:BlackWhite.cs

示例11: TriangleRegion

        public TriangleRegion(Image backgroundImage = null)
            : base(backgroundImage)
        {
            Angle = TriangleAngle.Top;

            KeyDown += TriangleRegion_KeyDown;
        }
开发者ID:Edison6351,项目名称:ShareX,代码行数:7,代码来源:TriangleRegion.cs

示例12: ResizeImage

        /// <summary>
        /// resmi yeniden boyutlandır.
        /// </summary>
        /// <param name="imgToResize">boyutlandırılacak resim</param>
        /// <param name="size">boyutlar</param>
        /// <returns>Image titipnde bir resim</returns>
        public static Image ResizeImage(Image imgToResize, Size size)
        {
            int sourceWidth = imgToResize.Width;
            int sourceHeight = imgToResize.Height;

            float nPercent = 0;
            float nPercentW = 0;
            float nPercentH = 0;

            nPercentW = ((float)size.Width / (float)sourceWidth);
            nPercentH = ((float)size.Height / (float)sourceHeight);

            if (nPercentH < nPercentW)
                nPercent = nPercentH;
            else
                nPercent = nPercentW;

            int destWidth = (int)(sourceWidth * nPercent);
            int destHeight = (int)(sourceHeight * nPercent);

            Bitmap b = new Bitmap(destWidth, destHeight);
            Graphics g = Graphics.FromImage((Image)b);
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;

            g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);
            g.Dispose();
            imgToResize.Dispose();

            return (Image)b;
        }
开发者ID:murat0058,项目名称:NewsSite,代码行数:36,代码来源:ImageManager.cs

示例13: ElementImageComparer

 public ElementImageComparer(IPurpleElement element)
 {
     this.element = element;
     CreateDirectory();
     liveImage = GetLiveImage();
     storedImage = GetStoredImage();
 }
开发者ID:tokarthik,项目名称:ProtoTest.Golem,代码行数:7,代码来源:ElementImageComparer.cs

示例14: ResizeImage

 public static Image ResizeImage(Image image, Size size, bool preserveAspectRatio = true)
 {
     int newWidth;
     int newHeight;
     if (preserveAspectRatio)
     {
         int originalWidth = image.Width;
         int originalHeight = image.Height;
         float percentWidth = size.Width / (float)originalWidth;
         float percentHeight = size.Height / (float)originalHeight;
         float percent = percentHeight < percentWidth ? percentHeight : percentWidth;
         newWidth = (int)(originalWidth * percent);
         newHeight = (int)(originalHeight * percent);
     }
     else
     {
         newWidth = size.Width;
         newHeight = size.Height;
     }
     Image newImage = new Bitmap(newWidth, newHeight);
     using (Graphics graphicsHandle = Graphics.FromImage(newImage))
     {
         graphicsHandle.InterpolationMode = InterpolationMode.HighQualityBicubic;
         graphicsHandle.DrawImage(image, 0, 0, newWidth, newHeight);
     }
     return newImage;
 }
开发者ID:sinaaslani,项目名称:kids.bmi.ir,代码行数:27,代码来源:FileUploadUtil.cs

示例15: Apply

 public override Image Apply(Image img)
 {
     using (img)
     {
         return ConvolutionMatrixManager.EdgeDetect().Apply(img);
     }
 }
开发者ID:andre-d,项目名称:ShareXYZ,代码行数:7,代码来源:EdgeDetect.cs


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