ImageExtensionsMixAlphaIntoRgb Method
Removes the transparency from an image, by drawing it onto a solid colored background.
Uses "CompositingMode.SourceOver" to mix the alpha channel of the image with its rgb channels.
** only needed for image formats where the alpha channel is not considered (e.g. jpg) **
Namespace: PCBI_API_Extensions.ExtensionsAssembly: PCBI.API_Library (in PCBI.API_Library.dll) Version: 17.0.0.0 (17.0.0.0)
public static Image MixAlphaIntoRgb(
this Image img,
Color backgroundColor,
bool disposeOrigImg = true
)
<ExtensionAttribute>
Public Shared Function MixAlphaIntoRgb (
img As Image,
backgroundColor As Color,
Optional disposeOrigImg As Boolean = true
) As Image
public:
[ExtensionAttribute]
static Image^ MixAlphaIntoRgb(
Image^ img,
Color backgroundColor,
bool disposeOrigImg = true
)
[<ExtensionAttribute>]
static member MixAlphaIntoRgb :
img : Image *
backgroundColor : Color *
?disposeOrigImg : bool
(* Defaults:
let _disposeOrigImg = defaultArg disposeOrigImg true
*)
-> Image
- img Image
- backgroundColor Color
- The color on which the transparent image is drawn.
- disposeOrigImg Boolean (Optional)
- Should the original image be disposed after the operation?
ImageIn Visual Basic and C#, you can call this method as an instance method on any object of type
Image. 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).