Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
Questionhow to use .m file in C# Pin
Darko Nikolovski21-Nov-10 22:54
Darko Nikolovski21-Nov-10 22:54 
AnswerRe: how to use .m file in C# Pin
Niladri_Biswas22-Nov-10 2:53
Niladri_Biswas22-Nov-10 2:53 
QuestionImage minus image Pin
pancakeleh21-Nov-10 14:59
pancakeleh21-Nov-10 14:59 
AnswerRe: Image minus image Pin
Manfred Rudolf Bihy21-Nov-10 15:12
professionalManfred Rudolf Bihy21-Nov-10 15:12 
GeneralRe: Image minus image Pin
pancakeleh21-Nov-10 15:20
pancakeleh21-Nov-10 15:20 
GeneralRe: Image minus image Pin
JF201521-Nov-10 18:28
JF201521-Nov-10 18:28 
GeneralRe: Image minus image Pin
pancakeleh21-Nov-10 18:42
pancakeleh21-Nov-10 18:42 
GeneralRe: Image minus image PinPopular
JF201521-Nov-10 18:45
JF201521-Nov-10 18:45 
public static Bitmap Diff(Bitmap src1, Bitmap src2, int x1, int y1, int x2, int y2, int width, int height)
{
    Bitmap diffBM = new Bitmap(width, height, PixelFormat.Format24bppRgb);

    for (int y = 0; y < height; y++)
    {
        for (int x = 0; x < width; x++)
        {
                //Get Both Colours at the pixel point
                Color col1 = src1.GetPixel(x1 + x, y1 + y);
                Color col2 = src2.GetPixel(x2 + x, y2 + y);

                //Get the difference RGB
                int r = 0, g = 0, b = 0;
                r = Math.Abs(col1.R - col2.R);
                g = Math.Abs(col1.G - col2.G);
                b = Math.Abs(col1.B - col2.B);

                //Invert the difference average
                int dif = 255 - ((r+g+b) / 3);

                //Create new grayscale rgb colour
                Color newcol = Color.FromArgb(dif, dif, dif);

                diffBM.SetPixel(x, y, newcol);

        }
    }
    return diffBM;
}


This code should create a greyscale image that shows the difference between two bitmaps. If you need more information, ask google. There's lots of information to be found about this topic.
GeneralRe: Image minus image Pin
Alan Balkany23-Nov-10 3:51
Alan Balkany23-Nov-10 3:51 
QuestionCreate installers dynamically Pin
Jacob D Dixon21-Nov-10 7:05
Jacob D Dixon21-Nov-10 7:05 
AnswerRe: Create installers dynamically [modified] Pin
Richard Andrew x6421-Nov-10 10:12
professionalRichard Andrew x6421-Nov-10 10:12 
GeneralvRe: Create installers dynamically [modified] Pin
Jacob D Dixon21-Nov-10 12:23
Jacob D Dixon21-Nov-10 12:23 
GeneralRe: vRe: Create installers dynamically Pin
Not Active21-Nov-10 12:37
mentorNot Active21-Nov-10 12:37 
GeneralRe: vRe: Create installers dynamically Pin
Jacob D Dixon21-Nov-10 15:46
Jacob D Dixon21-Nov-10 15:46 
AnswerRe: Create installers dynamically Pin
Mirko198022-Nov-10 2:14
Mirko198022-Nov-10 2:14 
GeneralRe: Create installers dynamically [modified] Pin
Jacob D Dixon22-Nov-10 11:33
Jacob D Dixon22-Nov-10 11:33 
QuestionConverting an particular color in an image to another color Pin
pancakeleh21-Nov-10 4:41
pancakeleh21-Nov-10 4:41 
AnswerRe: Converting color in an image [modified] Pin
Manfred Rudolf Bihy21-Nov-10 4:50
professionalManfred Rudolf Bihy21-Nov-10 4:50 
AnswerRe: Converting color in an image Pin
Richard Andrew x6421-Nov-10 4:51
professionalRichard Andrew x6421-Nov-10 4:51 
AnswerRe: Converting an particular color in an image to another color Pin
pancakeleh21-Nov-10 5:15
pancakeleh21-Nov-10 5:15 
GeneralRe: Converting an particular color in an image to another color Pin
_Erik_22-Nov-10 6:13
_Erik_22-Nov-10 6:13 
QuestionGot a 512 error on calling acmStreamOpen() in c# Pin
Alegria_Lee20-Nov-10 14:30
Alegria_Lee20-Nov-10 14:30 
AnswerRe: Got a 512 error on calling acmStreamOpen() in c# Pin
Luc Pattyn20-Nov-10 16:36
sitebuilderLuc Pattyn20-Nov-10 16:36 
AnswerRe: Got a 512 error on calling acmStreamOpen() in c# Pin
Bernhard Hiller21-Nov-10 23:00
Bernhard Hiller21-Nov-10 23:00 
GeneralRe: Got a 512 error on calling acmStreamOpen() in c# Pin
Alegria_Lee22-Nov-10 1:11
Alegria_Lee22-Nov-10 1:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.