Esempio n. 1
0
        public static ImageInterpolation ToEto(this sd2.InterpolationMode value)
        {
            switch (value)
            {
            case sd2.InterpolationMode.NearestNeighbor:
                return(ImageInterpolation.None);

            case sd2.InterpolationMode.Low:
                return(ImageInterpolation.Low);

            case sd2.InterpolationMode.High:
                return(ImageInterpolation.Medium);

            case sd2.InterpolationMode.HighQualityBilinear:
                return(ImageInterpolation.High);

            case sd2.InterpolationMode.Default:
                return(ImageInterpolation.Default);

            case sd2.InterpolationMode.HighQualityBicubic:
            case sd2.InterpolationMode.Bicubic:
            case sd2.InterpolationMode.Bilinear:
            default:
                throw new NotSupportedException();
            }
        }
Esempio n. 2
0
 public ScrapBase()
 {
     this.InitializeComponent();
     base.KeyPreview         = true;
     this.closePrepare       = false;
     this._dragmode          = false;
     this._scale             = 100;
     this._opacity           = base.Opacity;
     this._blTargetSet       = false;
     this._ptTarget          = new Point();
     this._solidframe        = true;
     this._inactiveOpacity   = this.Opacity;
     this._activeOpacity     = this.Opacity;
     this._rolloverOpacity   = this.Opacity;
     this.DateTime           = System.DateTime.Now.ToString();
     this.Name               = this.DateTime.Replace("/", "").Replace(":", "").Replace("浏览", "").Replace(" ", "-");
     this._interpolationmode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
 }
Esempio n. 3
0
        public static void DrawTextShadow(Graphics g, string text, PointF point, Font font, Color color)
        {
            point = new PointF(point.X, point.Y - 0.5f);

            GraphicsPath path = new GraphicsPath();

            path.AddString(text, font.FontFamily, (int)font.Style, g.DpiY * font.SizeInPoints / 72, point, StringFormat.GenericDefault);

            System.Drawing.Drawing2D.SmoothingMode oldSmoothingMode = g.SmoothingMode;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

            System.Drawing.Drawing2D.InterpolationMode oldInterpolationMode = g.InterpolationMode;
            g.InterpolationMode = InterpolationMode.Bilinear;

            using (Pen pen = new Pen(color, 5)) {
                g.DrawPath(pen, path);
            }


            g.SmoothingMode     = oldSmoothingMode;
            g.InterpolationMode = oldInterpolationMode;
        }