Beispiel #1
0
        public void EncodeStroke(RasterInkStroke stroke)
        {
            var rasterBrush = stroke.RasterBrush;
            var style       = new Wacom.Ink.Serialization.Model.Style(rasterBrush.Name);

            style.PathPointProperties.Red   = stroke.StrokeConstants.Color.R / 255.0f;
            style.PathPointProperties.Green = stroke.StrokeConstants.Color.G / 255.0f;
            style.PathPointProperties.Blue  = stroke.StrokeConstants.Color.B / 255.0f;
            style.PathPointProperties.Alpha = stroke.StrokeConstants.Color.A / 255.0f;

            AddRasterBrushToInkDoc(stroke.PointerDeviceType, rasterBrush, style, stroke.StrokeConstants, stroke.RandomSeed);
            EncodeStrokeCommon(stroke.Id, stroke.Spline, stroke.Layout, stroke.SensorDataId, style);
        }
        public void EncodeCurrentStroke(string pointerDeviceType, RasterInkBuilder inkBuilder, StrokeConstants strokeConstants, uint startRandomSeed)
        {
            var rasterBrush = inkBuilder.CreateSerializationBrush("will://examples/brushes/" + Guid.NewGuid().ToString());
            var style       = new Wacom.Ink.Serialization.Model.Style(rasterBrush.Name);

            style.PathPointProperties.Red   = strokeConstants.Color.R / 255.0f;
            style.PathPointProperties.Green = strokeConstants.Color.G / 255.0f;
            style.PathPointProperties.Blue  = strokeConstants.Color.B / 255.0f;
            style.PathPointProperties.Alpha = strokeConstants.Color.A / 255.0f;

            AddRasterBrushToInkDoc(pointerDeviceType, rasterBrush, style, strokeConstants, startRandomSeed);
            EncodeCurrentStrokeCommon(pointerDeviceType, inkBuilder, style);
        }
Beispiel #3
0
        public void EncodeStroke(VectorInkStroke stroke)
        {
            var vectorBrush = new Wacom.Ink.Serialization.Model.VectorBrush(
                "will://examples/brushes/" + Guid.NewGuid().ToString(),
                stroke.VectorBrush.Polygons);

            var style = new Wacom.Ink.Serialization.Model.Style(vectorBrush.Name);

            style.PathPointProperties.Red   = stroke.Color.R / 255.0f;
            style.PathPointProperties.Green = stroke.Color.G / 255.0f;
            style.PathPointProperties.Blue  = stroke.Color.B / 255.0f;
            style.PathPointProperties.Alpha = stroke.Color.A / 255.0f;

            AddVectorBrushToInkDoc(stroke.PointerDeviceType.ToString(), vectorBrush, style);
            EncodeStrokeCommon(stroke.Id, stroke.Spline.Clone(), stroke.Layout, stroke.SensorDataId, style);
        }
        public void EncodeCurrentStroke(string pointerDeviceType, VectorInkBuilder inkBuilder, MediaColor brushColor)
        {
            var vectorBrush = new Wacom.Ink.Serialization.Model.VectorBrush(
                "will://examples/brushes/" + Guid.NewGuid().ToString(),
                inkBuilder.BrushApplier.Prototype.Polygons);

            var style = new Wacom.Ink.Serialization.Model.Style(vectorBrush.Name);

            style.PathPointProperties.Red   = brushColor.R / 255.0f;
            style.PathPointProperties.Green = brushColor.G / 255.0f;
            style.PathPointProperties.Blue  = brushColor.B / 255.0f;
            style.PathPointProperties.Alpha = brushColor.A / 255.0f;

            AddVectorBrushToInkDoc(pointerDeviceType, vectorBrush, style);
            EncodeCurrentStrokeCommon(pointerDeviceType, inkBuilder, style);
        }