BitmapExtensionsGetRegion Method
Gets a region from the specified Bitmap.
Namespace: DevCase.Extensions.BitmapExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static Region GetRegion(
this Bitmap bitmap,
Color transparencyKey,
byte tolerance
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function GetRegion (
bitmap As Bitmap,
transparencyKey As Color,
tolerance As Byte
) As Region
Dim bitmap As Bitmap
Dim transparencyKey As Color
Dim tolerance As Byte
Dim returnValue As Region
returnValue = bitmap.GetRegion(transparencyKey,
tolerance)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static Region^ GetRegion(
Bitmap^ bitmap,
Color transparencyKey,
unsigned char tolerance
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member GetRegion :
bitmap : Bitmap *
transparencyKey : Color *
tolerance : byte -> Region
No code example is currently available or this language may not be supported.
- bitmap Bitmap
-
The source Bitmap.
- transparencyKey Color
-
The transparency key.
- tolerance Byte
-
The tolerance value. From 0 to 255.
Region
The resulting
Region.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Bitmap. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example that demonstrates how to make a shape transparent Form.
No code example is currently available or this language may not be supported.
Public Class Form1 : Inherits Form
Public Sub New()
' This call is required by the designer.
InitializeComponent()
' Needed to make a custom shaped Form.
Me.FormBorderStyle = FormBorderStyle.None
Me.Width = Me.BackgroundImage.Width
Me.Height = Me.BackgroundImage.Height
' Shape the Form
Me.Region = Me.BackgroundImage.GetRegion(Color.FromArgb(0, 255, 0), 100)
End Sub
End Class
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.