-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDirect2D.cs
More file actions
15154 lines (13876 loc) · 656 KB
/
Direct2D.cs
File metadata and controls
15154 lines (13876 loc) · 656 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#define DWRITE
using System;
using System.Runtime.InteropServices;
using DXGI;
using WIC;
using GlobalStructures;
using static DXGI.DXGITools;
using System.Runtime.CompilerServices;
using static Direct2D.D2DTools;
using System.IO;
#if DWRITE
using DWrite;
#endif
namespace Direct2D
{
public enum D2D1_FACTORY_TYPE : uint
{
//
// The resulting factory and derived resources may only be invoked serially.
// Reference counts on resources are interlocked, however, resource and render
// target state is not protected from multi-threaded access.
//
D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
//
// The resulting factory may be invoked from multiple threads. Returned resources
// use interlocked reference counting and their state is protected.
//
D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
D2D1_FACTORY_TYPE_FORCE_DWORD = 0xffffffff
}
public enum D2D1_DEBUG_LEVEL : uint
{
D2D1_DEBUG_LEVEL_NONE = 0,
D2D1_DEBUG_LEVEL_ERROR = 1,
D2D1_DEBUG_LEVEL_WARNING = 2,
D2D1_DEBUG_LEVEL_INFORMATION = 3,
D2D1_DEBUG_LEVEL_FORCE_DWORD = 0xffffffff
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_FACTORY_OPTIONS
{
public D2D1_DEBUG_LEVEL debugLevel;
}
public enum D2D1_RENDER_TARGET_TYPE
{
//
// D2D is free to choose the render target type for the caller.
//
D2D1_RENDER_TARGET_TYPE_DEFAULT = 0,
//
// The render target will render using the CPU.
//
D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1,
//
// The render target will render using the GPU.
//
D2D1_RENDER_TARGET_TYPE_HARDWARE = 2,
D2D1_RENDER_TARGET_TYPE_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_ALPHA_MODE
{
//
// Alpha mode should be determined implicitly. Some target surfaces do not supply
// or imply this information in which case alpha must be specified.
//
D2D1_ALPHA_MODE_UNKNOWN = 0,
//
// Treat the alpha as premultipled.
//
D2D1_ALPHA_MODE_PREMULTIPLIED = 1,
//
// Opacity is in the 'A' component only.
//
D2D1_ALPHA_MODE_STRAIGHT = 2,
//
// Ignore any alpha channel information.
//
D2D1_ALPHA_MODE_IGNORE = 3,
D2D1_ALPHA_MODE_FORCE_DWORD = unchecked((int)0xffffffff)
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_PIXEL_FORMAT
{
public DXGI_FORMAT format;
public D2D1_ALPHA_MODE alphaMode;
}
public enum D2D1_RENDER_TARGET_USAGE
{
D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000,
//
// Rendering will occur locally, if a terminal-services session is established, the
// bitmap updates will be sent to the terminal services client.
//
D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001,
//
// The render target will allow a call to GetDC on the ID2D1GdiInteropRenderTarget
// interface. Rendering will also occur locally.
//
D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002,
D2D1_RENDER_TARGET_USAGE_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_FEATURE_LEVEL
{
//
// The caller does not require a particular underlying D3D device level.
//
D2D1_FEATURE_LEVEL_DEFAULT = 0,
//
// The D3D device level is DX9 compatible.
//
D2D1_FEATURE_LEVEL_9 = D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_9_1,
//
// The D3D device level is DX10 compatible.
//
D2D1_FEATURE_LEVEL_10 = D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_10_0,
D2D1_FEATURE_LEVEL_FORCE_DWORD = unchecked((int)0xffffffff)
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_RENDER_TARGET_PROPERTIES
{
public D2D1_RENDER_TARGET_TYPE type;
public D2D1_PIXEL_FORMAT pixelFormat;
public float dpiX;
public float dpiY;
public D2D1_RENDER_TARGET_USAGE usage;
public D2D1_FEATURE_LEVEL minLevel;
}
public enum D2D1_WINDOW_STATE
{
D2D1_WINDOW_STATE_NONE = 0x0000000,
D2D1_WINDOW_STATE_OCCLUDED = 0x0000001,
D2D1_WINDOW_STATE_FORCE_DWORD = unchecked((int)0xffffffff)
}
[ComImport]
[Guid("2cd906a8-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1Brush : ID2D1Resource
{
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
void SetOpacity(float opacity);
[PreserveSig]
void SetTransform(D2D1_MATRIX_3X2_F transform);
[PreserveSig]
float GetOpacity();
[PreserveSig]
void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
}
[ComImport]
[Guid("2cd906aa-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1BitmapBrush : ID2D1Brush
{
#region ID2D1Brush
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new void SetOpacity(float opacity);
[PreserveSig]
new void SetTransform(D2D1_MATRIX_3X2_F transform);
[PreserveSig]
new float GetOpacity();
[PreserveSig]
new void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
#endregion
[PreserveSig]
void SetExtendModeX(D2D1_EXTEND_MODE extendModeX);
[PreserveSig]
void SetExtendModeY(D2D1_EXTEND_MODE extendModeY);
[PreserveSig]
void SetInterpolationMode(D2D1_BITMAP_INTERPOLATION_MODE interpolationMode);
[PreserveSig]
void SetBitmap(ID2D1Bitmap bitmap);
[PreserveSig]
void GetExtendModeX(out D2D1_EXTEND_MODE extendedModeX);
[PreserveSig]
void GetExtendModeY(out D2D1_EXTEND_MODE extendedModeY);
[PreserveSig]
void GetInterpolationMode(out D2D1_BITMAP_INTERPOLATION_MODE interpolationMode);
[PreserveSig]
void GetBitmap(out ID2D1Bitmap bitmap);
}
[ComImport]
[Guid("2cd906ab-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1LinearGradientBrush : ID2D1Brush
{
#region ID2D1Brush
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new void SetOpacity(float opacity);
[PreserveSig]
new void SetTransform(D2D1_MATRIX_3X2_F transform);
[PreserveSig]
new float GetOpacity();
[PreserveSig]
new void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
#endregion
[PreserveSig]
void SetStartPoint(D2D1_POINT_2F startPoint);
[PreserveSig]
void SetEndPoint(D2D1_POINT_2F endPoint);
[PreserveSig]
void GetStartPoint(out D2D1_POINT_2F startPoint);
[PreserveSig]
void GetEndPoint(out D2D1_POINT_2F endPoint);
[PreserveSig]
void GetGradientStopCollection(out ID2D1GradientStopCollection gradientStopCollection);
}
[ComImport]
[Guid("2cd906ac-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1RadialGradientBrush : ID2D1Brush
{
#region ID2D1Brush
#region ID2D1Resource
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new void SetOpacity(float opacity);
[PreserveSig]
new void SetTransform(D2D1_MATRIX_3X2_F transform);
[PreserveSig]
new float GetOpacity();
[PreserveSig]
new void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
#endregion
[PreserveSig]
void SetCenter(ref D2D1_POINT_2F center);
[PreserveSig]
void SetGradientOriginOffset(ref D2D1_POINT_2F gradientOriginOffset);
[PreserveSig]
void SetRadiusX(float radiusX);
[PreserveSig]
void SetRadiusY(float radiusY);
[PreserveSig]
void GetCenter(out D2D1_POINT_2F center);
[PreserveSig]
void GetGradientOriginOffset(out D2D1_POINT_2F gradientOriginOffset);
[PreserveSig]
float GetRadiusX();
[PreserveSig]
float GetRadiusY();
[PreserveSig]
void GetGradientStopCollection(out ID2D1GradientStopCollection gradientStopCollection);
}
[ComImport]
[Guid("2cd9069d-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1StrokeStyle : ID2D1Resource
{
#region ID2D1Resource
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
void GetStartCap(out D2D1_CAP_STYLE capStyle);
[PreserveSig]
void GetEndCap(out D2D1_CAP_STYLE capStyle);
[PreserveSig]
void GetDashCap(out D2D1_CAP_STYLE capStyle);
[PreserveSig]
float GetMiterLimit();
[PreserveSig]
void GetLineJoin(out D2D1_LINE_JOIN lineJoin);
[PreserveSig]
float GetDashOffset();
[PreserveSig]
void GetDashStyle(out D2D1_DASH_STYLE dashStyle);
[PreserveSig]
uint GetDashesCount();
[PreserveSig]
void GetDashes(out float dashes, uint dashesCount);
}
public enum D2D1_GEOMETRY_RELATION
{
//
// The relation between the geometries couldn't be determined. This value is never
// returned by any D2D method.
//
D2D1_GEOMETRY_RELATION_UNKNOWN = 0,
//
// The two geometries do not intersect at all.
//
D2D1_GEOMETRY_RELATION_DISJOINT = 1,
//
// The passed in geometry is entirely contained by the object. //
D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2,
//
// The object entirely contains the passed in geometry.
//
D2D1_GEOMETRY_RELATION_CONTAINS = 3,
//
// The two geometries overlap but neither completely contains the other.
//
D2D1_GEOMETRY_RELATION_OVERLAP = 4,
D2D1_GEOMETRY_RELATION_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION
{
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1,
D2D1_GEOMETRY_SIMPLIFICATION_OPTION_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_COMBINE_MODE
{
//
// Produce a geometry representing the set of points contained in either
// the first or the second geometry.
//
D2D1_COMBINE_MODE_UNION = 0,
//
// Produce a geometry representing the set of points common to the first
// and the second geometries.
//
D2D1_COMBINE_MODE_INTERSECT = 1,
//
// Produce a geometry representing the set of points contained in the
// first geometry or the second geometry, but not both.
//
D2D1_COMBINE_MODE_XOR = 2,
//
// Produce a geometry representing the set of points contained in the
// first geometry but not the second geometry.
//
D2D1_COMBINE_MODE_EXCLUDE = 3,
D2D1_COMBINE_MODE_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_PATH_SEGMENT
{
D2D1_PATH_SEGMENT_NONE = 0x00000000,
D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001,
D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002,
D2D1_PATH_SEGMENT_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_FIGURE_BEGIN
{
D2D1_FIGURE_BEGIN_FILLED = 0,
D2D1_FIGURE_BEGIN_HOLLOW = 1,
D2D1_FIGURE_BEGIN_FORCE_DWORD = unchecked((int)0xffffffff)
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_BEZIER_SEGMENT
{
public D2D1_POINT_2F point1;
public D2D1_POINT_2F point2;
public D2D1_POINT_2F point3;
}
public enum D2D1_FIGURE_END
{
D2D1_FIGURE_END_OPEN = 0,
D2D1_FIGURE_END_CLOSED = 1,
D2D1_FIGURE_END_FORCE_DWORD = unchecked((int)0xffffffff)
}
[ComImport]
[Guid("2cd9069e-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1SimplifiedGeometrySink
{
[PreserveSig]
HRESULT SetFillMode(D2D1_FILL_MODE fillMode);
[PreserveSig]
HRESULT SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags);
[PreserveSig]
HRESULT BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin);
[PreserveSig]
HRESULT AddLines([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_POINT_2F[] points, int pointsCount);
[PreserveSig]
HRESULT AddBeziers([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_BEZIER_SEGMENT[] beziers, int beziersCount);
[PreserveSig]
HRESULT EndFigure(D2D1_FIGURE_END figureEnd);
[PreserveSig]
HRESULT Close();
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_QUADRATIC_BEZIER_SEGMENT
{
public D2D1_POINT_2F point1;
public D2D1_POINT_2F point2;
}
public enum D2D1_SWEEP_DIRECTION
{
D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0,
D2D1_SWEEP_DIRECTION_CLOCKWISE = 1,
D2D1_SWEEP_DIRECTION_FORCE_DWORD = unchecked((int)0xffffffff)
}
public enum D2D1_ARC_SIZE
{
D2D1_ARC_SIZE_SMALL = 0,
D2D1_ARC_SIZE_LARGE = 1,
D2D1_ARC_SIZE_FORCE_DWORD = unchecked((int)0xffffffff)
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_ARC_SEGMENT
{
public D2D1_POINT_2F point;
public D2D1_SIZE_F size;
public float rotationAngle;
public D2D1_SWEEP_DIRECTION sweepDirection;
public D2D1_ARC_SIZE arcSize;
}
[ComImport]
[Guid("e0db51c3-6f77-4bae-b3d5-e47509b35838")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1GdiInteropRenderTarget
{
[PreserveSig]
HRESULT GetDC(D2D1_DC_INITIALIZE_MODE mode, out IntPtr hdc);
[PreserveSig]
HRESULT ReleaseDC(ref RECT update);
}
public enum D2D1_DC_INITIALIZE_MODE
{
/// <summary>
/// The contents of the D2D render target will be copied to the DC.
/// </summary>
D2D1_DC_INITIALIZE_MODE_COPY = 0,
/// <summary>
/// The contents of the DC will be cleared.
/// </summary>
D2D1_DC_INITIALIZE_MODE_CLEAR = 1,
D2D1_DC_INITIALIZE_MODE_FORCE_DWORD = unchecked((int)0xffffffff)
}
[ComImport]
[Guid("2cd9069f-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1GeometrySink : ID2D1SimplifiedGeometrySink
{
#region ID2D1SimplifiedGeometrySink
[PreserveSig]
new HRESULT SetFillMode(D2D1_FILL_MODE fillMode);
[PreserveSig]
new HRESULT SetSegmentFlags(D2D1_PATH_SEGMENT vertexFlags);
[PreserveSig]
new HRESULT BeginFigure(D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin);
[PreserveSig]
new HRESULT AddLines([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_POINT_2F[] points, int pointsCount);
[PreserveSig]
new HRESULT AddBeziers([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_BEZIER_SEGMENT[] beziers, int beziersCount);
[PreserveSig]
new HRESULT EndFigure(D2D1_FIGURE_END figureEnd);
[PreserveSig]
new HRESULT Close();
#endregion
[PreserveSig]
HRESULT AddLine(D2D1_POINT_2F point);
[PreserveSig]
HRESULT AddBezier(ref D2D1_BEZIER_SEGMENT bezier);
[PreserveSig]
HRESULT AddQuadraticBezier(ref D2D1_QUADRATIC_BEZIER_SEGMENT bezier);
[PreserveSig]
HRESULT AddQuadraticBeziers( [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_QUADRATIC_BEZIER_SEGMENT[] beziers, int beziersCount);
[PreserveSig]
HRESULT AddArc(ref D2D1_ARC_SEGMENT arc);
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_TRIANGLE
{
public D2D1_POINT_2F point1;
public D2D1_POINT_2F point2;
public D2D1_POINT_2F point3;
}
[ComImport]
[Guid("2cd906c1-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1TessellationSink
{
[PreserveSig]
void AddTriangles(D2D1_TRIANGLE triangles, uint trianglesCount);
[PreserveSig]
void Close();
}
[ComImport]
[Guid("2cd906a1-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1Geometry : ID2D1Resource
{
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
}
[ComImport]
[Guid("2cd906a3-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1RoundedRectangleGeometry : ID2D1Geometry
{
#region ID2D1Geometry
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
new HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
new HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
new HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
new HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
new HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
#endregion
[PreserveSig]
void GetRoundedRect(out D2D1_ROUNDED_RECT roundedRect);
}
[ComImport]
[Guid("2cd906a4-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1EllipseGeometry : ID2D1Geometry
{
#region ID2D1Geometry
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
new HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
new HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
new HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
new HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
new HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
#endregion
[PreserveSig]
void GetEllipse(out D2D1_ELLIPSE ellipse);
}
[ComImport]
[Guid("2cd906a6-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1GeometryGroup : ID2D1Geometry
{
#region ID2D1Geometry
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
new HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
new HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
new HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
new HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
new HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
#endregion
[PreserveSig]
void GetFillMode(out D2D1_FILL_MODE fillMode);
[PreserveSig]
int GetSourceGeometryCount();
[PreserveSig]
void GetSourceGeometries(out ID2D1Geometry geometries, int geometriesCount);
}
[ComImport]
[Guid("2cd906bb-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1TransformedGeometry : ID2D1Geometry
{
#region ID2D1Geometry
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
new HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
new HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
new HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
new HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
new HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
#endregion
[PreserveSig]
void GetSourceGeometry(out ID2D1Geometry sourceGeometry);
[PreserveSig]
void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
}
[ComImport]
[Guid("2cd906a5-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1PathGeometry : ID2D1Geometry
{
#region ID2D1Geometry
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT GetBounds(D2D1_MATRIX_3X2_F worldTransform, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT GetWidenedBounds(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_RECT_F bounds);
[PreserveSig]
new HRESULT StrokeContainsPoint(ref D2D1_POINT_2F point, float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT FillContainsPoint(ref D2D1_POINT_2F point, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out bool contains);
[PreserveSig]
new HRESULT CompareWithGeometry(ID2D1Geometry inputGeometry, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, out D2D1_GEOMETRY_RELATION relation);
[PreserveSig]
new HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Tessellate(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1TessellationSink tessellationSink);
[PreserveSig]
new HRESULT CombineWithGeometry(ID2D1Geometry inputGeometry, D2D1_COMBINE_MODE combineMode, D2D1_MATRIX_3X2_F inputGeometryTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT Outline(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
[PreserveSig]
new HRESULT ComputeArea(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float area);
[PreserveSig]
new HRESULT ComputeLength(D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out float length);
[PreserveSig]
new HRESULT ComputePointAtLength(float length, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, out D2D1_POINT_2F point, out D2D1_POINT_2F unitTangentVector);
[PreserveSig]
new HRESULT Widen(float strokeWidth, ID2D1StrokeStyle strokeStyle, D2D1_MATRIX_3X2_F worldTransform, float flatteningTolerance, ID2D1SimplifiedGeometrySink geometrySink);
#endregion
[PreserveSig]
HRESULT Open(out ID2D1GeometrySink geometrySink);
[PreserveSig]
HRESULT Stream(ID2D1GeometrySink geometrySink);
[PreserveSig]
HRESULT GetSegmentCount(out int count);
[PreserveSig]
HRESULT GetFigureCount(out int count);
}
[ComImport]
[Guid("28506e39-ebf6-46a1-bb47-fd85565ab957")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1DrawingStateBlock : ID2D1Resource
{
#region ID2D1Resource
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
void GetDescription(out D2D1_DRAWING_STATE_DESCRIPTION stateDescription);
[PreserveSig]
void SetDescription(D2D1_DRAWING_STATE_DESCRIPTION stateDescription);
[PreserveSig]
void SetTextRenderingParams(IDWriteRenderingParams textRenderingParams = null);
[PreserveSig]
void GetTextRenderingParams(out IDWriteRenderingParams textRenderingParams);
}
[ComImport]
[Guid("2cd90698-12e2-11dc-9fed-001143a055f9")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ID2D1HwndRenderTarget : ID2D1RenderTarget
{
#region <ID2D1RenderTarget>
#region <ID2D1Resource>
[PreserveSig]
new void GetFactory(out ID2D1Factory factory);
#endregion
[PreserveSig]
new HRESULT CreateBitmap(D2D1_SIZE_U size, IntPtr srcData, uint pitch, ref D2D1_BITMAP_PROPERTIES bitmapProperties, out ID2D1Bitmap bitmap);
[PreserveSig]
new HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource wicBitmapSource, ref D2D1_BITMAP_PROPERTIES bitmapProperties, out ID2D1Bitmap bitmap);
[PreserveSig]
new HRESULT CreateSharedBitmap(ref Guid riid, [In, Out] IntPtr data, ref D2D1_BITMAP_PROPERTIES bitmapProperties, out ID2D1Bitmap bitmap);
[PreserveSig]
new HRESULT CreateBitmapBrush(ID2D1Bitmap bitmap, ref D2D1_BITMAP_BRUSH_PROPERTIES bitmapBrushProperties, ref D2D1_BRUSH_PROPERTIES brushProperties, out ID2D1BitmapBrush bitmapBrush);
[PreserveSig]
new HRESULT CreateSolidColorBrush(D2D1_COLOR_F color, ref D2D1_BRUSH_PROPERTIES brushProperties, out ID2D1SolidColorBrush solidColorBrush);
[PreserveSig]
//new HRESULT CreateSolidColorBrush(D2D1_COLOR_F color, IntPtr brushProperties, out ID2D1SolidColorBrush solidColorBrush);
new HRESULT CreateGradientStopCollection([MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] D2D1_GRADIENT_STOP[] gradientStops, uint gradientStopsCount, D2D1_GAMMA colorInterpolationGamma, D2D1_EXTEND_MODE extendMode, out ID2D1GradientStopCollection gradientStopCollection);
[PreserveSig]
new HRESULT CreateLinearGradientBrush(ref D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES linearGradientBrushProperties, IntPtr brushProperties, ID2D1GradientStopCollection gradientStopCollection, out ID2D1LinearGradientBrush linearGradientBrush);
[PreserveSig]
new HRESULT CreateRadialGradientBrush(ref D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES radialGradientBrushProperties, IntPtr brushProperties, ID2D1GradientStopCollection gradientStopCollection, out ID2D1RadialGradientBrush radialGradientBrush);
[PreserveSig]
new HRESULT CreateCompatibleRenderTarget(ref D2D1_SIZE_F desiredSize, ref D2D1_SIZE_U desiredPixelSize, ref D2D1_PIXEL_FORMAT desiredFormat, D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS options, out ID2D1BitmapRenderTarget bitmapRenderTarget);
[PreserveSig]
new HRESULT CreateLayer(ref D2D1_SIZE_F size, out ID2D1Layer layer);
[PreserveSig]
new void CreateMesh(out ID2D1Mesh mesh);
[PreserveSig]
new void DrawLine(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush brush, float strokeWidth = 1.0f, ID2D1StrokeStyle strokeStyle = null);
[PreserveSig]
new void DrawRectangle(ref D2D1_RECT_F rect, ID2D1Brush brush, float strokeWidth = 1.0f, ID2D1StrokeStyle strokeStyle = null);
[PreserveSig]
new void FillRectangle(ref D2D1_RECT_F rect, ID2D1Brush brush);
[PreserveSig]
new void DrawRoundedRectangle(ref D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush, float strokeWidth = 1.0f, ID2D1StrokeStyle strokeStyle = null);
[PreserveSig]
new void FillRoundedRectangle(ref D2D1_ROUNDED_RECT roundedRect, ID2D1Brush brush);
[PreserveSig]
new void DrawEllipse(ref D2D1_ELLIPSE ellipse, ID2D1Brush brush, float strokeWidth = 1.0f, ID2D1StrokeStyle strokeStyle = null);
[PreserveSig]
new void FillEllipse(ref D2D1_ELLIPSE ellipse, ID2D1Brush brush);
[PreserveSig]
new void DrawGeometry(ID2D1Geometry geometry, ID2D1Brush brush, float strokeWidth = 1.0f, ID2D1StrokeStyle strokeStyle = null);
[PreserveSig]
new void FillGeometry(ID2D1Geometry geometry, ID2D1Brush brush, ID2D1Brush opacityBrush = null);
[PreserveSig]
new void FillMesh(ID2D1Mesh mesh, ID2D1Brush brush);
[PreserveSig]
new void FillOpacityMask(ID2D1Bitmap opacityMask, ID2D1Brush brush, D2D1_OPACITY_MASK_CONTENT content, D2D1_RECT_F destinationRectangle, D2D1_RECT_F sourceRectangle);
[PreserveSig]
new void DrawBitmap(ID2D1Bitmap bitmap, ref D2D1_RECT_F destinationRectangle, float opacity, D2D1_BITMAP_INTERPOLATION_MODE interpolationMode, ref D2D1_RECT_F sourceRectangle);
[PreserveSig]
new void DrawText(string str, uint stringLength, IDWriteTextFormat textFormat, ref D2D1_RECT_F layoutRect, ID2D1Brush defaultForegroundBrush, D2D1_DRAW_TEXT_OPTIONS options, DWRITE_MEASURING_MODE measuringMode);
[PreserveSig]
new void DrawTextLayout(D2D1_POINT_2F origin, IDWriteTextLayout textLayout, ID2D1Brush defaultForegroundBrush, D2D1_DRAW_TEXT_OPTIONS options);
[PreserveSig]
new void DrawGlyphRun(D2D1_POINT_2F baselineOrigin, ref DWRITE_GLYPH_RUN glyphRun, ID2D1Brush foregroundBrush, DWRITE_MEASURING_MODE measuringMode);
[PreserveSig]
new void SetTransform(D2D1_MATRIX_3X2_F transform);
[PreserveSig]
new void GetTransform(out D2D1_MATRIX_3X2_F_STRUCT transform);
[PreserveSig]
new void SetAntialiasMode(D2D1_ANTIALIAS_MODE antialiasMode);
[PreserveSig]
new void GetAntialiasMode(out D2D1_ANTIALIAS_MODE antialiasMode);
[PreserveSig]
new void SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode);
[PreserveSig]
new void GetTextAntialiasMode(out D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode);
[PreserveSig]
new void SetTextRenderingParams(IDWriteRenderingParams textRenderingParams = null);
[PreserveSig]
new void GetTextRenderingParams(out IDWriteRenderingParams textRenderingParams);
[PreserveSig]
new void SetTags(UInt64 tag1, UInt64 tag2);
[PreserveSig]
new void GetTags(out UInt64 tag1, out UInt64 tag2);
[PreserveSig]
new void PushLayer(ref D2D1_LAYER_PARAMETERS layerParameters, ID2D1Layer layer);
[PreserveSig]
new void PopLayer();
[PreserveSig]
new void Flush(out UInt64 tag1, out UInt64 tag2);
[PreserveSig]
new void SaveDrawingState([In, Out] ID2D1DrawingStateBlock drawingStateBlock);
[PreserveSig]
new void RestoreDrawingState(ID2D1DrawingStateBlock drawingStateBlock);
[PreserveSig]
new void PushAxisAlignedClip(D2D1_RECT_F clipRect, D2D1_ANTIALIAS_MODE antialiasMode);
[PreserveSig]
new void PopAxisAlignedClip();
[PreserveSig]
new void Clear(D2D1_COLOR_F clearColor);
[PreserveSig]
new void BeginDraw();
[PreserveSig]
new HRESULT EndDraw(out UInt64 tag1, out UInt64 tag2);
[PreserveSig]
new void GetPixelFormat(out D2D1_PIXEL_FORMAT format);
[PreserveSig]
new void SetDpi(float dpiX, float dpiY);
[PreserveSig]
new void GetDpi(out float dpiX, out float dpiY);
[PreserveSig]
new void GetSize(out D2D1_SIZE_F size);
[PreserveSig]
new void GetPixelSize(out D2D1_SIZE_U size);
[PreserveSig]
new uint GetMaximumBitmapSize();
[PreserveSig]
new bool IsSupported(D2D1_RENDER_TARGET_PROPERTIES renderTargetProperties);
//new HRESULT Function1();
//new HRESULT Function2();
//new HRESULT Function3();
//new HRESULT Function4();
//new HRESULT Function5();
//new HRESULT Function6();
//new HRESULT Function7();
//new HRESULT Function8();
//new HRESULT Function9();
//new HRESULT Function10();
//new HRESULT Function11();
//new HRESULT Function12();
//new HRESULT Function13();
//new HRESULT Function14();
//new HRESULT Function15();
//new HRESULT Function16();
//new HRESULT Function17();
//new HRESULT Function18();
//new HRESULT Function19();
//new HRESULT Function20();
//new HRESULT Function21();
//new void Function22();
//new void Function23();
//new void Function24();
//new void Function25();
//new void Function26();
//new void Function27();
//new void Function28();
//new void Function29();
//new void Function30();
//new void Function31();
//new void Function32();
//new void Function33();
//new void Function34();
//new void Function35();
//new bool Function36();
#endregion
[PreserveSig]
D2D1_WINDOW_STATE CheckWindowState();
[PreserveSig]
HRESULT Resize(ref D2D1_SIZE_U pixelSize);
//[return: MarshalAs(UnmanagedType.SysInt)]
[PreserveSig]
IntPtr GetHwnd();
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_SIZE_U
{
public uint width;
public uint height;
public D2D1_SIZE_U(uint width, uint height)
{
this.width = width;
this.height = height;
}
}
[StructLayout(LayoutKind.Sequential)]
public struct D2D1_VECTOR_2F
{
public float x;
public float y;
public D2D1_VECTOR_2F(float x, float y)
{
this.x = x;