BitmapExtensionsGetColors Method
Gets the colors used in the defined bitmap. A limit can be defined in maxColors.
Namespace: KGySoft.DrawingAssembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 8.1.0
public static Color[] GetColors(
this Bitmap bitmap,
int maxColors = 0,
bool forceScanningContent = false
)
<ExtensionAttribute>
Public Shared Function GetColors (
bitmap As Bitmap,
Optional maxColors As Integer = 0,
Optional forceScanningContent As Boolean = false
) As Color()
public:
[ExtensionAttribute]
static array<Color>^ GetColors(
Bitmap^ bitmap,
int maxColors = 0,
bool forceScanningContent = false
)
[<ExtensionAttribute>]
static member GetColors :
bitmap : Bitmap *
?maxColors : int *
?forceScanningContent : bool
(* Defaults:
let _maxColors = defaultArg maxColors 0
let _forceScanningContent = defaultArg forceScanningContent false
*)
-> Color[]
- bitmap Bitmap
- The bitmap, whose colors have to be returned. If it is indexed and the forceScanningContent parameter is ,
then its palette entries are returned and maxColors is ignored.
- maxColors Int32 (Optional)
- A limit of the returned colors. If forceScanningContent parameter is , then
this parameter is ignored for indexed bitmaps. Use 0 for no limit. This parameter is optional.
Default value: 0. - forceScanningContent Boolean (Optional)
- to force scanning the actual image content even if the specified bitmap is
indexed and has a palette. This parameter is optional.
Default value: .
ColorAn array of
Color entries.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).