Click here to Skip to main content
11,705,763 members (48,862 online)
   

C#

 
AnswerRe: Problems with File Pin
OriginalGriff12-Dec-12 5:03
mvpOriginalGriff12-Dec-12 5:03 
GeneralRe: Problems with File Pin
tiwal12-Dec-12 5:17
membertiwal12-Dec-12 5:17 
GeneralRe: Problems with File Pin
OriginalGriff12-Dec-12 5:23
mvpOriginalGriff12-Dec-12 5:23 
Questionproblem with using pointers in C# Pin
siawash_s12-Dec-12 4:38
membersiawash_s12-Dec-12 4:38 
AnswerRe: problem with using pointers in C# Pin
Eddy Vluggen12-Dec-12 4:44
memberEddy Vluggen12-Dec-12 4:44 
GeneralRe: problem with using pointers in C# Pin
siawash_s13-Dec-12 1:09
membersiawash_s13-Dec-12 1:09 
AnswerRe: problem with using pointers in C# Pin
Abhinav S12-Dec-12 5:04
mvpAbhinav S12-Dec-12 5:04 
AnswerRe: problem with using pointers in C# Pin
OriginalGriff12-Dec-12 5:06
mvpOriginalGriff12-Dec-12 5:06 
AnswerRe: problem with using pointers in C# Pin
DaveyM6912-Dec-12 8:08
mentorDaveyM6912-Dec-12 8:08 
AnswerRe: problem with using pointers in C# Pin
Member 857512112-Dec-12 10:57
memberMember 857512112-Dec-12 10:57 
QuestionValue of label is not changing upon loading or changing the value of the combobox Pin
jon-8012-Dec-12 4:37
memberjon-8012-Dec-12 4:37 
AnswerRe: Value of label is not changing upon loading or changing the value of the combobox Pin
Eddy Vluggen12-Dec-12 4:42
memberEddy Vluggen12-Dec-12 4:42 
AnswerRe: Value of label is not changing upon loading or changing the value of the combobox Pin
Freak3012-Dec-12 4:52
memberFreak3012-Dec-12 4:52 
QuestionApply diff image on the original image c# Pin
Tridip Bhattacharjee12-Dec-12 0:22
memberTridip Bhattacharjee12-Dec-12 0:22 
suppose i have two image with same height and width. pic1.jpg & pic2.jpg. two image look pretty same with minimum difference. with the help of below routine we can get the difference between two images.this below routine is not my routine.

public class ImageDifferences
{
private static ILog mLog = LogManager.GetLogger("ImageDifferences");

public static unsafe Bitmap PixelDiff(Image a, Image b)
{
if (!a.Size.Equals(b.Size)) return null;
if (!(a is Bitmap) || !(b is Bitmap)) return null;

return PixelDiff(a as Bitmap, b as Bitmap);
}

public static unsafe Bitmap PixelDiff(Bitmap a, Bitmap b)
{
Bitmap output = new Bitmap(
Math.Max(a.Width, b.Width),
Math.Max(a.Height, b.Height),
PixelFormat.Format32bppArgb);

Rectangle recta = new Rectangle(Point.Empty, a.Size);
Rectangle rectb = new Rectangle(Point.Empty, b.Size);
Rectangle rectOutput = new Rectangle(Point.Empty, output.Size);

BitmapData aData = a.LockBits(recta, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
BitmapData bData = b.LockBits(rectb, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
BitmapData outputData = output.LockBits(rectOutput, ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);

try
{
byte* aPtr = (byte*)aData.Scan0;
byte* bPtr = (byte*)bData.Scan0;
byte* outputPtr = (byte*)outputData.Scan0;
int len = aData.Stride * aData.Height;

for (int i = 0; i < len; i++)
{
// For alpha use the average of both images (otherwise pixels with the same alpha won't be visible)
if ((i + 1) % 4 == 0)
*outputPtr = (byte)((*aPtr + *bPtr) / 2);
else
*outputPtr = (byte)~(*aPtr ^ *bPtr);

outputPtr++;
aPtr++;
bPtr++;
}

return output;
}
catch (Exception ex)
{

return null;
}
finally
{
a.UnlockBits(aData);
b.UnlockBits(bData);
output.UnlockBits(outputData);
}
}
}
}

after getting the difference how could i merge the difference on first image.

this below way we can merge

using (Graphics grfx = Graphics.FromImage(image))
{
grfx.DrawImage(newImage, x, y)
}

but we need to know the x & y from where the new image will be drawn on first image. can any one tell me how can i get the x & y position from the above routine called PixelDiff() thanks in advance.
tbhattacharjee

QuestionTwo image compare using win32 api c# Pin
Tridip Bhattacharjee12-Dec-12 0:21
memberTridip Bhattacharjee12-Dec-12 0:21 
AnswerRe: Two image compare using win32 api c# Pin
Pete O'Hanlon12-Dec-12 1:01
protectorPete O'Hanlon12-Dec-12 1:01 
QuestionCode does not appear to be called when program is run Pin
bikerben12-Dec-12 0:07
memberbikerben12-Dec-12 0:07 
AnswerRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 1:06
protectorPete O'Hanlon12-Dec-12 1:06 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 1:23
memberbikerben12-Dec-12 1:23 
GeneralRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 2:25
protectorPete O'Hanlon12-Dec-12 2:25 
SuggestionRe: Code does not appear to be called when program is run Pin
Richard MacCutchan12-Dec-12 3:07
mvpRichard MacCutchan12-Dec-12 3:07 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 3:12
memberbikerben12-Dec-12 3:12 
GeneralRe: Code does not appear to be called when program is run Pin
Alan N12-Dec-12 3:07
memberAlan N12-Dec-12 3:07 
QuestionTFS and WIX Pin
Pascal Ganaye11-Dec-12 22:33
memberPascal Ganaye11-Dec-12 22:33 
QuestionCanny edge detection in c# Pin
neha198711-Dec-12 22:11
memberneha198711-Dec-12 22:11 
AnswerRe: Canny edge detection in c# Pin
Simon_Whale11-Dec-12 22:23
memberSimon_Whale11-Dec-12 22:23 
AnswerRe: Canny edge detection in c# Pin
Pete O'Hanlon11-Dec-12 22:34
protectorPete O'Hanlon11-Dec-12 22:34 
QuestionWCF Services in a multi threaded application results in Oracle Connection request Timed out error Pin
rajaron11-Dec-12 21:56
memberrajaron11-Dec-12 21:56 
AnswerRe: WCF Services in a multi threaded application results in Oracle Connection request Timed out error Pin
Eddy Vluggen12-Dec-12 3:05
memberEddy Vluggen12-Dec-12 3:05 
GeneralRunning code as different user Pin
MacUseless11-Dec-12 21:35
memberMacUseless11-Dec-12 21:35 
SuggestionRe: Running code as different user Pin
Richard Deeming12-Dec-12 1:51
memberRichard Deeming12-Dec-12 1:51 
AnswerRe: Running code as different user Pin
Eddy Vluggen12-Dec-12 3:31
memberEddy Vluggen12-Dec-12 3:31 
QuestionHTML TO XML Convertion using C# Pin
chittu dinesh11-Dec-12 20:29
memberchittu dinesh11-Dec-12 20:29 
AnswerRe: HTML TO XML Convertion using C# Pin
Pete O'Hanlon11-Dec-12 20:41
protectorPete O'Hanlon11-Dec-12 20:41 
GeneralRe: HTML TO XML Convertion using C# Pin
chittu dinesh11-Dec-12 22:41
memberchittu dinesh11-Dec-12 22:41 
AnswerRe: HTML TO XML Convertion using C# Pin
BobJanova12-Dec-12 4:25
memberBobJanova12-Dec-12 4:25 
QuestionFor Developinf Login Application for windows Pin
Member 913168411-Dec-12 20:02
memberMember 913168411-Dec-12 20:02 
AnswerRe: For Developinf Login Application for windows Pin
Pete O'Hanlon11-Dec-12 20:54
protectorPete O'Hanlon11-Dec-12 20:54 
AnswerRe: For Developinf Login Application for windows Pin
Richard Deeming12-Dec-12 1:48
memberRichard Deeming12-Dec-12 1:48 
Questionstoring image in isolated storage Pin
singh123456711-Dec-12 18:39
membersingh123456711-Dec-12 18:39 
QuestionHow to print an SSRS Report in PDF Format from my asp.net page Pin
Vinay Meka11-Dec-12 18:04
memberVinay Meka11-Dec-12 18:04 
AnswerRe: How to print an SSRS Report in PDF Format from my asp.net page Pin
Richard Deeming12-Dec-12 1:42
memberRichard Deeming12-Dec-12 1:42 
Questionadd labels to an image at different zoom levels Pin
vr99999999911-Dec-12 18:03
membervr99999999911-Dec-12 18:03 
AnswerRe: add labels to an image at different zoom levels Pin
Pete O'Hanlon11-Dec-12 20:17
protectorPete O'Hanlon11-Dec-12 20:17 
GeneralRe: add labels to an image at different zoom levels Pin
vr99999999911-Dec-12 20:28
membervr99999999911-Dec-12 20:28 
GeneralRe: add labels to an image at different zoom levels Pin
Pete O'Hanlon11-Dec-12 20:34
protectorPete O'Hanlon11-Dec-12 20:34 
GeneralRe: add labels to an image at different zoom levels Pin
vr99999999911-Dec-12 20:41
membervr99999999911-Dec-12 20:41 
Questionhello friend :) Pin
youshy11-Dec-12 7:38
memberyoushy11-Dec-12 7:38 
AnswerRe: hello friend :) Pin
Marcus Kramer11-Dec-12 8:03
memberMarcus Kramer11-Dec-12 8:03 
GeneralRe: hello friend :) Pin
youshy11-Dec-12 8:48
memberyoushy11-Dec-12 8:48 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 29 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid