You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/winforms/additional-security-considerations-in-windows-forms.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ helpviewer_keywords:
9
9
ms.assetid: 15abda8b-0527-47c7-aedb-77ab595f2bf1
10
10
---
11
11
# Additional Security Considerations in Windows Forms
12
-
[!INCLUDE[dnprdnshort](../../../includes/dnprdnshort-md.md)] security settings might cause your application to run differently in a partial trust environment than on your local computer. The [!INCLUDE[dnprdnshort](../../../includes/dnprdnshort-md.md)] restricts access to such critical local resources as the file system, network, and unmanaged APIs, among other things. The security settings affect the ability to call the Microsoft Win32 API or other APIs that cannot be verified by the security system. Security also affects other aspects of your application, including file and data access, and printing. For more information about file and data access in a partial trust environment, see [More Secure File and Data Access in Windows Forms](../../../docs/framework/winforms/more-secure-file-and-data-access-in-windows-forms.md). For more information about printing in a partial trust environment, see [More Secure Printing in Windows Forms](../../../docs/framework/winforms/more-secure-printing-in-windows-forms.md).
12
+
[!INCLUDE[dnprdnshort](../../../includes/dnprdnshort-md.md)] security settings might cause your application to run differently in a partial trust environment than on your local computer. The [!INCLUDE[dnprdnshort](../../../includes/dnprdnshort-md.md)] restricts access to such critical local resources as the file system, network, and unmanaged APIs, among other things. The security settings affect the ability to call the Microsoft Win32 API or other APIs that cannot be verified by the security system. Security also affects other aspects of your application, including file and data access, and printing. For more information about file and data access in a partial trust environment, see [More Secure File and Data Access in Windows Forms](more-secure-file-and-data-access-in-windows-forms.md). For more information about printing in a partial trust environment, see [More Secure Printing in Windows Forms](more-secure-printing-in-windows-forms.md).
13
13
14
14
The following sections discuss how to work with the Clipboard, perform window manipulation, and call the Win32 API from applications that are running in a partial trust environment.
If your application does not have permission to call unmanaged code, your application must request <xref:System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode> permission, or you must consider alternative ways of implementing features; in many cases, Windows Forms provides a managed alternative to Win32 API functions. If no alternative means exist and the application must access unmanaged code, you will have to elevate the permissions for the application.
82
82
83
-
Permission to call unmanaged code allows an application to perform most anything. Therefore, permission to call unmanaged code should only be granted for applications that come from a trusted source. Alternatively, depending on the application, the piece of application functionality that makes the call to unmanaged code could be optional, or enabled in the full trust environment only. For more information about dangerous permissions, see [Dangerous Permissions and Policy Administration](../../../docs/framework/misc/dangerous-permissions-and-policy-administration.md). For more information about elevating permissions, see [General Security Policy Administration](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ed5htz45(v=vs.100)).
83
+
Permission to call unmanaged code allows an application to perform most anything. Therefore, permission to call unmanaged code should only be granted for applications that come from a trusted source. Alternatively, depending on the application, the piece of application functionality that makes the call to unmanaged code could be optional, or enabled in the full trust environment only. For more information about dangerous permissions, see [Dangerous Permissions and Policy Administration](../misc/dangerous-permissions-and-policy-administration.md). For more information about elevating permissions, see [General Security Policy Administration](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ed5htz45(v=vs.100)).
84
84
85
85
## See also
86
-
-[More Secure File and Data Access in Windows Forms](../../../docs/framework/winforms/more-secure-file-and-data-access-in-windows-forms.md)
87
-
-[More Secure Printing in Windows Forms](../../../docs/framework/winforms/more-secure-printing-in-windows-forms.md)
88
-
-[Security in Windows Forms Overview](../../../docs/framework/winforms/security-in-windows-forms-overview.md)
89
-
-[Windows Forms Security](../../../docs/framework/winforms/windows-forms-security.md)
86
+
-[More Secure File and Data Access in Windows Forms](more-secure-file-and-data-access-in-windows-forms.md)
87
+
-[More Secure Printing in Windows Forms](more-secure-printing-in-windows-forms.md)
88
+
-[Security in Windows Forms Overview](security-in-windows-forms-overview.md)
89
+
-[Windows Forms Security](windows-forms-security.md)
This section provides information about the [!INCLUDE[ndptecgdiplus](../../../../includes/ndptecgdiplus-md.md)] API for programmers using managed code.
16
16
17
17
## In This Section
18
-
[Lines, Curves, and Shapes](../../../../docs/framework/winforms/advanced/lines-curves-and-shapes.md)
18
+
[Lines, Curves, and Shapes](lines-curves-and-shapes.md)
19
19
Discusses vector graphics.
20
20
21
-
[Images, Bitmaps, and Metafiles](../../../../docs/framework/winforms/advanced/images-bitmaps-and-metafiles.md)
21
+
[Images, Bitmaps, and Metafiles](images-bitmaps-and-metafiles.md)
22
22
Discusses the type of images available and how to work with them.
23
23
24
-
[Coordinate Systems and Transformations](../../../../docs/framework/winforms/advanced/coordinate-systems-and-transformations.md)
24
+
[Coordinate Systems and Transformations](coordinate-systems-and-transformations.md)
25
25
Discusses how to transform graphics with [!INCLUDE[ndptecgdiplus](../../../../includes/ndptecgdiplus-md.md)].
Copy file name to clipboardExpand all lines: docs/framework/winforms/advanced/alpha-blending-lines-and-fills.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,14 +24,14 @@ In [!INCLUDE[ndptecgdiplus](../../../../includes/ndptecgdiplus-md.md)], a color
24
24
150 × 200 / 255 + 100 × (255 – 200) / 255 = 139
25
25
26
26
## In This Section
27
-
[How to: Draw Opaque and Semitransparent Lines](../../../../docs/framework/winforms/advanced/how-to-draw-opaque-and-semitransparent-lines.md)
27
+
[How to: Draw Opaque and Semitransparent Lines](how-to-draw-opaque-and-semitransparent-lines.md)
28
28
Shows how to draw alpha-blended lines.
29
29
30
-
[How to: Draw with Opaque and Semitransparent Brushes](../../../../docs/framework/winforms/advanced/how-to-draw-with-opaque-and-semitransparent-brushes.md)
30
+
[How to: Draw with Opaque and Semitransparent Brushes](how-to-draw-with-opaque-and-semitransparent-brushes.md)
31
31
Explains how to alpha-blend with brushes.
32
32
33
-
[How to: Use Compositing Mode to Control Alpha Blending](../../../../docs/framework/winforms/advanced/how-to-use-compositing-mode-to-control-alpha-blending.md)
33
+
[How to: Use Compositing Mode to Control Alpha Blending](how-to-use-compositing-mode-to-control-alpha-blending.md)
34
34
Describes how to control alpha blending using <xref:System.Drawing.Drawing2D.CompositingMode>.
35
35
36
-
[How to: Use a Color Matrix to Set Alpha Values in Images](../../../../docs/framework/winforms/advanced/how-to-use-a-color-matrix-to-set-alpha-values-in-images.md)
36
+
[How to: Use a Color Matrix to Set Alpha Values in Images](how-to-use-a-color-matrix-to-set-alpha-values-in-images.md)
37
37
Explains how to use a <xref:System.Drawing.Imaging.ColorMatrix> object to control alpha blending.
Copy file name to clipboardExpand all lines: docs/framework/winforms/advanced/antialiasing-with-lines-and-curves.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,29 +16,29 @@ When you use [!INCLUDE[ndptecgdiplus](../../../../includes/ndptecgdiplus-md.md)]
16
16
## Aliasing
17
17
Consider the straight red line that goes from the point (4, 2) to the point (16, 10). Assume the coordinate system has its origin in the upper-left corner and that the unit of measure is the pixel. Also assume that the x-axis points to the right and the y-axis points down. The following illustration shows an enlarged view of the red line drawn on a multicolored background.
18
18
19
-

19
+

20
20
21
21
The red pixels used to render the line are opaque. There are no partially transparent pixels in the line. This type of line rendering gives the line a jagged appearance, and the line looks somewhat like a staircase. This technique of representing a line with a staircase is called aliasing; the staircase is an alias for the theoretical line.
22
22
23
23
## Antialiasing
24
24
A more sophisticated technique for rendering a line involves using partially transparent pixels along with opaque pixels. Pixels are set to pure red, or to some blend of red and the background color, depending on how close they are to the line. This type of rendering is called antialiasing and results in a line that the human eye perceives as more smooth. The following illustration shows how certain pixels are blended with the background to produce an antialiased line.
25
25
26
-

26
+

27
27
28
28
Antialiasing, also called smoothing, can also be applied to curves. The following illustration shows an enlarged view of a smoothed ellipse.
To draw lines and curves that use antialiasing, create an instance of the <xref:System.Drawing.Graphics> class and set its <xref:System.Drawing.Graphics.SmoothingMode%2A> property to <xref:System.Drawing.Drawing2D.SmoothingMode.AntiAlias> or <xref:System.Drawing.Drawing2D.SmoothingMode.HighQuality>. Then call one of the drawing methods of that same <xref:System.Drawing.Graphics> class.
0 commit comments