Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
This is a class having enumeration... there is one function with return time enumeration...
I want to access this method on a button's click event... how do I call this function.. and in which type of variable I retrieve the result???
Please guide me...
Thanks in advance!

C#
 public class ComparingImages
    {
        public enum CompareResult
        {
            ciCompareOk,
            ciPixelMismatch,
            ciSizeMismatch
        };

        public static CompareResult Compare(Bitmap bmp1, Bitmap bmp2)
        {
           ...........
            return cr;
        }
    }
}
Posted

1 solution

You can call it in following manner:

C#
Bitmap bmp1 = new Bitmap(@"C:\Documents and Settings\All Users\" 
            + @"Documents\My Music\music.bmp", true); //This is first bitmap. Replace it with your code.

Bitmap bmp2 = new Bitmap(@"C:\Documents and Settings\All Users\" 
            + @"Documents\My Music\music.bmp", true); //This is second bitmap. Replace it with your code.

CompareResult obj = ComparingImages.Compare(Bitmap bmp1, Bitmap bmp2); //The CompareResult is the type and obj is the variable to which the function will return.

//here include the lines how you want to use the return value.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900