ImageExtensions.EqualsByContent Method

KGy SOFT Drawing Libraries

ImageExtensionsEqualsByContent Method KGy SOFT Drawing Libraries Help
Compares an image to another one by content and returns whether they are equal. Images of different size or pixel format are considered as difference.

Namespace: KGySoft.Drawing
Assembly: KGySoft.Drawing (in KGySoft.Drawing.dll) Version: 4.6.1
Syntax

public static bool EqualsByContent(
	this Image image1,
	Image image2
)
<ExtensionAttribute>
Public Shared Function EqualsByContent ( 
	image1 As Image,
	image2 As Image
) As Boolean
public:
[ExtensionAttribute]
static bool EqualsByContent(
	Image^ image1, 
	Image^ image2
)
[<ExtensionAttribute>]
static member EqualsByContent : 
        image1 : Image * 
        image2 : Image -> bool 

Parameters

image1
Type: System.DrawingImage
First image instance.
image2
Type: System.DrawingImage
Second image instance.

Return Value

Type: Boolean
 if both images have the same content; otherwise, .

Usage Note

In 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).
Remarks

If an image is not a Bitmap instance, a temporary Bitmap is created for the check.
Note Note
This method compares images by raw content. If the images have padding in each stride (content row), padding content is considered as well.
See Also

Reference