public BitmapEffectInputData(BitmapEffect bitmapEffect,
                             BitmapEffectInput bitmapEffectInput)
 { 
     BitmapEffect = bitmapEffect;
     BitmapEffectInput = bitmapEffectInput; 
 } 
 public BitmapEffectInputData(BitmapEffect bitmapEffect,
                              BitmapEffectInput bitmapEffectInput)
 {
     BitmapEffect      = bitmapEffect;
     BitmapEffectInput = bitmapEffectInput;
 }
 public override void PushEffect(
     BitmapEffect effect,
     BitmapEffectInput effectInput)
 {
     _drawingContext.PushEffect(
         effect,
         effectInput
         );
 }
 public override void PushEffect(
     BitmapEffect effect,
     BitmapEffectInput effectInput)
 {
     if (!IsPushNoOp())
     {
         // This API has been deprecated, so any BitmapEffect is ignored.
         PushPointStack(_point);
     }               
 }
 public abstract void PushEffect(
     BitmapEffect effect,
     BitmapEffectInput effectInput);
示例#6
0
        public override void PushEffect(
            BitmapEffect effect,
            BitmapEffectInput effectInput)
        {
            VerifyApiNonstructuralChange();



        #if DEBUG
            MediaTrace.DrawingContextOp.Trace("PushEffect(const)");
        #endif

            unsafe
            {
                EnsureRenderData();



                MILCMD_PUSH_EFFECT record =
                    new MILCMD_PUSH_EFFECT (
                        _renderData.AddDependentResource(effect),
                        _renderData.AddDependentResource(effectInput)
                        );

                // Assert that the calculated packet size is the same as the size returned by sizeof().
                Debug.Assert(sizeof(MILCMD_PUSH_EFFECT) == 8);

                _renderData.WriteDataRecord(MILCMD.MilPushEffect,
                                            (byte*)&record,
                                            8 /* sizeof(MILCMD_PUSH_EFFECT) */);
            }                           

            _stackDepth++;                            
            if (_renderData.BitmapEffectStackDepth == 0)
            {
                _renderData.BeginTopLevelBitmapEffect(_stackDepth);
            }                                                                                  
        }
示例#7
0
 public override void PushEffect(
     BitmapEffect effect,
     BitmapEffectInput effectInput)
 {
     Debug.Assert(false);
 }
        public override void PushEffect(
            BitmapEffect effect, 
            BitmapEffectInput effectInput) 
        {
            // Ensure the type stack 
            PushTypeStack(PushType.BitmapEffect);

            // This API has been deprecated, so any BitmapEffect is ignored.
        } 
示例#9
0
 public VerticalIndicator()
 {
     _effect = new OuterGlowBitmapEffect { GlowColor = Colors.White, GlowSize = 20, Opacity = 1 };
     _effect.Freeze();
 }
        //该方法用于在画布上绘制一个图形,两个点用于表示图像的填充区域,image是原始的图片,angle是角度,只有{0,90,180,270}三个角度可选
        /***
        public void drawImage(Point leftTop, Point rightBottom, BitmapImage bitmapImage)
        {
            double left = leftTop.X;
            double top = leftTop.Y;
            double width = Math.Abs(leftTop.X - rightBottom.X);
            double height = Math.Abs(leftTop.Y - rightBottom.Y);

            double leftWithRatio = left * this.widthRatio;
            double topWithRatio = top * this.heightRatio;
            double widthWithRatio = width * this.widthRatio;
            double heightWithRatio = height * this.heightRatio;

            Image shelfImage = new Image();
            //RotateTransform rotateTransform = new RotateTransform(angle);
           
            //DropShadowBitmapEffect bitmapEffect = new DropShadowBitmapEffect();
            //Color myShadowColor = new Color();
            //myShadowColor.ScA = 1;
            //myShadowColor.ScB = 0;
            //myShadowColor.ScG = 0;
            //myShadowColor.ScR = 0;
            //bitmapEffect.Color = myShadowColor;
            //bitmapEffect.Direction = 320;
            //bitmapEffect.ShadowDepth = 10;
            //bitmapEffect.Softness = 0.1;
            //bitmapEffect.Opacity = 0.1;
            shelfImage.Source = bitmapImage;
            shelfImage.Stretch = Stretch.Uniform;
            //shelfImage.BitmapEffect = bitmapEffect;
            //shelfImage.RenderTransform = rotateTransform;
            //shelfImage.Width = widthWithRatio;shelfImage.Height = heightWithRatio;
            shelfImage.Width = heightWithRatio; shelfImage.Height = widthWithRatio;            

            Canvas.SetTop(shelfImage,topWithRatio);//adjust the postion
            Canvas.SetLeft(shelfImage, leftWithRatio);
            Canvas.SetZIndex(shelfImage, -10);
            this.currentCanvas.Children.Add(shelfImage);
        }
        ***/
        public void drawImage(Point leftTop, Point rightBottom, BitmapImage bitmapImage, 
            Transform rotateTransform, BitmapEffect bitmapEffect)
        {
            double left = leftTop.X;
            double top = leftTop.Y;
            double width = Math.Abs(leftTop.X - rightBottom.X);
            double height = Math.Abs(leftTop.Y - rightBottom.Y);
            double leftWithRatio = left * this.widthRatio;
            double topWithRatio = top * this.heightRatio;
            double widthWithRatio = width * this.widthRatio;
            double heightWithRatio = height * this.heightRatio;

            Image shelfImage = new Image();
            shelfImage.Source = bitmapImage;
            shelfImage.Stretch = Stretch.Fill;
            shelfImage.RenderTransform = rotateTransform;
            shelfImage.BitmapEffect = bitmapEffect;
            shelfImage.Width = widthWithRatio-3;
            shelfImage.Height = heightWithRatio;
            //shelfImage.Width = heightWithRatio; shelfImage.Height = widthWithRatio;

            Canvas.SetTop(shelfImage, topWithRatio);//adjust the postion
            Canvas.SetLeft(shelfImage, leftWithRatio);
            Canvas.SetZIndex(shelfImage, -10);
            this.currentCanvas.Children.Add(shelfImage);
        }
示例#11
0
        public override void PushEffect(
            BitmapEffect effect,
            BitmapEffectInput effectInput) 
        {
 
#if DEBUG 
            MediaTrace.DrawingContextOp.Trace("PushEffect(const)");
#endif 

            //
            // Verify that parameters & state are valid
            // 

 
 
            VerifyApiNonstructuralChange();
 
            //
            // Instantiate a new drawing group and set it as the _currentDrawingGroup
            //
 
            PushNewDrawingGroup();
 
            // 
            // Set the transform on the new DrawingGroup
            // 

            // NOTE: [....]  Disabling this API for now

            _currentDrawingGroup.BitmapEffect = effect; 
            _currentDrawingGroup.BitmapEffectInput = (effectInput != null) ?
                                                        effectInput : new BitmapEffectInput(); 
 
        }