/// <summary> /// Initializes a new instance of the OutlineFuncs class. /// </summary> /// <param name="moveTo">The move to delegate.</param> /// <param name="lineTo">The line to delegate.</param> /// <param name="conicTo">The conic to delegate.</param> /// <param name="cubicTo">The cubic to delegate.</param> /// <param name="shift">A value to shift by.</param> /// <param name="delta">A delta to transform by.</param> /// <exception cref="ArgumentNullException"><paramref name="moveTo"/>, <paramref name="lineTo"/>, /// <paramref name="conicTo"/>, or <paramref name="cubicTo"/> is <see langword="null" />.</exception> public OutlineFuncs(MoveToFunc moveTo, LineToFunc lineTo, ConicToFunc conicTo, CubicToFunc cubicTo, int shift, int delta) { /* * if (moveTo == null) * { * throw new ArgumentNullException(nameof(moveTo)); * } * if (lineTo == null) * { * throw new ArgumentNullException(nameof(lineTo)); * } * if (conicTo == null) * { * throw new ArgumentNullException(nameof(conicTo)); * } * if (cubicTo == null) * { * throw new ArgumentNullException(nameof(cubicTo)); * } */ moveToFunc = moveTo; lineToFunc = lineTo; conicToFunc = conicTo; cubicToFunc = cubicTo; moveToPtr = Marshal.GetFunctionPointerForDelegate(moveToFunc); lineToPtr = Marshal.GetFunctionPointerForDelegate(lineToFunc); conicToPtr = Marshal.GetFunctionPointerForDelegate(conicToFunc); cubicToPtr = Marshal.GetFunctionPointerForDelegate(cubicToFunc); this.shift = shift; this.delta = (IntPtr)delta; }
/// <summary> /// Initializes a new instance of the OutlineFuncs class. /// </summary> /// <param name="moveTo">The move to delegate.</param> /// <param name="lineTo">The line to delegate.</param> /// <param name="conicTo">The conic to delegate.</param> /// <param name="cubicTo">The cubic to delegate.</param> /// <param name="shift">A value to shift by.</param> /// <param name="delta">A delta to transform by.</param> /// <exception cref="ArgumentNullException"><paramref name="moveTo"/>, <paramref name="lineTo"/>, /// <paramref name="conicTo"/>, or <paramref name="cubicTo"/> is <see langword="null" />.</exception> public OutlineFuncs(MoveToFunc moveTo, LineToFunc lineTo, ConicToFunc conicTo, CubicToFunc cubicTo, int shift, int delta) { if (moveTo == null) { throw new ArgumentNullException(nameof(moveTo)); } if (lineTo == null) { throw new ArgumentNullException(nameof(lineTo)); } if (conicTo == null) { throw new ArgumentNullException(nameof(conicTo)); } if (cubicTo == null) { throw new ArgumentNullException(nameof(cubicTo)); } moveToFunc = moveTo; lineToFunc = lineTo; conicToFunc = conicTo; cubicToFunc = cubicTo; moveToPtr = Marshal.GetFunctionPointerForDelegate(moveToFunc); lineToPtr = Marshal.GetFunctionPointerForDelegate(lineToFunc); conicToPtr = Marshal.GetFunctionPointerForDelegate(conicToFunc); cubicToPtr = Marshal.GetFunctionPointerForDelegate(cubicToFunc); this.shift = shift; this.delta = (IntPtr) delta; }
/// <summary> /// Initializes a new instance of the OutlineFuncs class. /// </summary> /// <param name="moveTo">The move to delegate.</param> /// <param name="lineTo">The line to delegate.</param> /// <param name="conicTo">The conic to delegate.</param> /// <param name="cubicTo">The cubic to delegate.</param> /// <param name="shift">A value to shift by.</param> /// <param name="delta">A delta to transform by.</param> public OutlineFuncs(MoveToFunc moveTo, LineToFunc lineTo, ConicToFunc conicTo, CubicToFunc cubicTo, int shift, int delta) { rec.moveTo = moveTo; rec.lineTo = lineTo; rec.conicTo = conicTo; rec.cubicTo = cubicTo; rec.shift = shift; #if WIN64 rec.delta = delta; #else rec.delta = (IntPtr)delta; #endif }
/// <summary> /// Initializes a new instance of the OutlineFuncs class. /// </summary> /// <param name="moveTo">The move to delegate.</param> /// <param name="lineTo">The line to delegate.</param> /// <param name="conicTo">The conic to delegate.</param> /// <param name="cubicTo">The cubic to delegate.</param> /// <param name="shift">A value to shift by.</param> /// <param name="delta">A delta to transform by.</param> public OutlineFuncs(MoveToFunc moveTo, LineToFunc lineTo, ConicToFunc conicTo, CubicToFunc cubicTo, int shift, int delta) { rec.moveTo = Marshal.GetFunctionPointerForDelegate(moveTo); rec.lineTo = Marshal.GetFunctionPointerForDelegate(lineTo); rec.conicTo = Marshal.GetFunctionPointerForDelegate(conicTo); rec.cubicTo = Marshal.GetFunctionPointerForDelegate(cubicTo); rec.shift = shift; rec.delta = (IntPtr)delta; }
/// <summary> /// Initializes a new instance of the OutlineFuncs class. /// </summary> /// <param name="moveTo">The move to delegate.</param> /// <param name="lineTo">The line to delegate.</param> /// <param name="conicTo">The conic to delegate.</param> /// <param name="cubicTo">The cubic to delegate.</param> /// <param name="shift">A value to shift by.</param> /// <param name="delta">A delta to transform by.</param> public OutlineFuncs(MoveToFunc moveTo, LineToFunc lineTo, ConicToFunc conicTo, CubicToFunc cubicTo, int shift, int delta) { rec.moveTo = Marshal.GetFunctionPointerForDelegate(moveTo); rec.lineTo = Marshal.GetFunctionPointerForDelegate(lineTo); rec.conicTo = Marshal.GetFunctionPointerForDelegate(conicTo); rec.cubicTo = Marshal.GetFunctionPointerForDelegate(cubicTo); rec.shift = shift; #if WIN64 rec.delta = delta; #else rec.delta = (IntPtr)delta; #endif }