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

C# Drawing.Image类代码示例

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

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



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


示例16: GetReducedImage

 public static Image GetReducedImage(Image image, int extremeWidth, int extremeHeight) {
     double ratio = (double)image.Width / (double)image.Height;
     Size size = new Size(extremeWidth, (int)(extremeWidth / ratio));
     if(size.Height > extremeHeight)
         size = new Size((int)(extremeHeight * ratio), extremeHeight);
     return new Bitmap(image, size);
 }
开发者ID:cuongpv88,项目名称:work,代码行数:7,代码来源:PhotoUtils.cs


示例17: CompareAndSave

 private void CompareAndSave(string filename, Image testImage, ICommandAdapter adapter) {
     var threshold = this.ParameterValue<byte>("ImageDiffThreshold", 3);
     var localImage = Image.FromFile(filename);
     var masks = GetMasks(adapter).ToArray();
     var validDiffPercentace = this.ParameterValue("ValidDiffPercentage", 10);
     if (!masks.Any()) {
         var maskRectangle = GetMaskRectangle(adapter);
         if (maskRectangle != Rectangle.Empty) {
             CreateMask(filename, testImage, maskRectangle);                    
         } else {
             maskRectangle=new Rectangle(0,0,testImage.Width-1,testImage.Height-1);
         }
         var isValidPercentage = IsValidPercentage(testImage, maskRectangle, threshold, validDiffPercentace, localImage);
         if (!isValidPercentage)
             SaveImages(filename, testImage, threshold, localImage, maskRectangle);
     }
     var height = this.ParameterValue("MaskHeight", 0);
     var width = this.ParameterValue("MaskWidth", 0);
     foreach (var mask in masks) {
         var maskImage = mask;
         if (width > 0 && height > 0) {
             maskImage = (Bitmap)maskImage.ResizeRectangle(width, height);
         }
         var isValidPercentage = IsValidPercentage(testImage, maskImage, threshold, validDiffPercentace, localImage);
         if (!isValidPercentage)
             SaveImages(filename, testImage, threshold, localImage, maskImage);
     }
 }
开发者ID:derjabkin,项目名称:eXpand,代码行数:28,代码来源:XpandCompareScreenshotCommand.cs


示例18: ProcessImage

        public void ProcessImage()
        {
            if (_isFirst)
            {
                _nextImage = _prevImage = _image.Convert<Gray, byte>();
                _isFirst = !_isFirst;
            }
            else
            {
                _prevImage = _nextImage;
                _nextImage = _image.Convert<Gray, byte>();
                var imageResult = TinhSuChenhLech();
                _lstRectangles = _videoUlity.DetectBlock(imageResult, imageResult.Width, imageResult.Height);

                //draw rectangle
                foreach (var rectangle in _lstRectangles)
                {
                    var drawRec = new Rectangle(
                    rectangle.X,
                    rectangle.Y,
                    rectangle.Size.Width,
                    rectangle.Size.Height
                    );
                    _image.Draw(drawRec, new Bgr(Color.Yellow), 2);
                }
                _picScreen.Image = _image.Clone().ToBitmap();
            }
        }
开发者ID:vutiendung,项目名称:ThucTapTopNghiep,代码行数:28,代码来源:frmChenhLechTamThoi.cs


示例19: Alert

 public bool Alert(Form Owner, string Message, Image Image = null)
 {
     action.Caption = "សំគាល់";
     action.Description = Message;
     action.Image = Image;
     return Show(Owner, action, properties, canCloseFunc) == DialogResult.Yes;
 }
开发者ID:konzuk,项目名称:LoanProjectSQL,代码行数:7,代码来源:KZFlyoutDialog.cs


示例20: Apply

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Drawing.ImageConverter类代码示例发布时间:2022-05-26
下一篇:
C# Drawing.Icon类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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