當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。