Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do i get value from string textBox in C# Pin
Charmain Bush26-Feb-20 20:06
Charmain Bush26-Feb-20 20:06 
AnswerRe: How do i get value from string textBox in C# Pin
OriginalGriff2-Feb-20 19:35
mveOriginalGriff2-Feb-20 19:35 
AnswerRe: How do i get value from string textBox in C# Pin
Gerry Schmitz3-Feb-20 4:19
mveGerry Schmitz3-Feb-20 4:19 
QuestionSearching for a bitmap on my screen Pin
Atlaskor2-Feb-20 13:35
Atlaskor2-Feb-20 13:35 
AnswerRe: Searching for a bitmap on my screen Pin
Eddy Vluggen3-Feb-20 2:57
professionalEddy Vluggen3-Feb-20 2:57 
GeneralRe: Searching for a bitmap on my screen Pin
Atlaskor3-Feb-20 5:08
Atlaskor3-Feb-20 5:08 
GeneralRe: Searching for a bitmap on my screen Pin
Eddy Vluggen3-Feb-20 6:26
professionalEddy Vluggen3-Feb-20 6:26 
GeneralRe: Searching for a bitmap on my screen Pin
Atlaskor3-Feb-20 8:24
Atlaskor3-Feb-20 8:24 
Attempting this bit instead. Its going need a ton of modification in my existing code but i think i can make it work.

public static bool CompareBitmapsFast(Bitmap bmp1, Bitmap bmp2)
{
    if (bmp1 == null || bmp2 == null)
        return false;
    if (object.Equals(bmp1, bmp2))
        return true;
    if (!bmp1.Size.Equals(bmp2.Size) || !bmp1.PixelFormat.Equals(bmp2.PixelFormat))
        return false;
 
    int bytes = bmp1.Width * bmp1.Height * (Image.GetPixelFormatSize(bmp1.PixelFormat) / 8);
 
    bool result = true;
    byte[] b1bytes = new byte[bytes];
    byte[] b2bytes = new byte[bytes];
 
    BitmapData bitmapData1 = bmp1.LockBits(new Rectangle(0, 0, bmp1.Width, bmp1.Height), ImageLockMode.ReadOnly, bmp1.PixelFormat);
    BitmapData bitmapData2 = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadOnly, bmp2.PixelFormat);
 
    Marshal.Copy(bitmapData1.Scan0, b1bytes, 0, bytes);
    Marshal.Copy(bitmapData2.Scan0, b2bytes, 0, bytes);
 
    for (int n = 0; n <= bytes - 1; n++)
    {
        if (b1bytes[n] != b2bytes[n])
        {
            result = false;
            break;
        }
    }
 
    bmp1.UnlockBits(bitmapData1);
    bmp2.UnlockBits(bitmapData2);
 
    return result;
}


I believe i can make it work though. Hopefully. This would be faster right?

modified 3-Feb-20 15:05pm.

GeneralRe: Searching for a bitmap on my screen Pin
Eddy Vluggen3-Feb-20 9:07
professionalEddy Vluggen3-Feb-20 9:07 
GeneralRe: Searching for a bitmap on my screen Pin
Atlaskor3-Feb-20 9:11
Atlaskor3-Feb-20 9:11 
GeneralRe: Searching for a bitmap on my screen Pin
Eddy Vluggen3-Feb-20 10:25
professionalEddy Vluggen3-Feb-20 10:25 
AnswerRe: Searching for a bitmap on my screen Pin
Gerry Schmitz3-Feb-20 4:11
mveGerry Schmitz3-Feb-20 4:11 
GeneralRe: Searching for a bitmap on my screen Pin
Atlaskor3-Feb-20 5:21
Atlaskor3-Feb-20 5:21 
QuestionHow to read specific field value when using LINQ to object to fetch data Pin
Mou_kol31-Jan-20 10:05
Mou_kol31-Jan-20 10:05 
AnswerRe: How to read specific field value when using LINQ to object to fetch data Pin
ZurdoDev31-Jan-20 10:47
professionalZurdoDev31-Jan-20 10:47 
AnswerRe: How to read specific field value when using LINQ to object to fetch data Pin
Gerry Schmitz31-Jan-20 10:49
mveGerry Schmitz31-Jan-20 10:49 
AnswerRe: How to read specific field value when using LINQ to object to fetch data Pin
Eddy Vluggen31-Jan-20 11:05
professionalEddy Vluggen31-Jan-20 11:05 
QuestionHow to make a "dungeon"(kinda of a small labyrinth) using devc and matrix Pin
Member 1472865028-Jan-20 19:44
Member 1472865028-Jan-20 19:44 
AnswerRe: How to make a "dungeon"(kinda of a small labyrinth) using devc and matrix Pin
OriginalGriff28-Jan-20 20:12
mveOriginalGriff28-Jan-20 20:12 
QuestionRe: How to make a "dungeon"(kinda of a small labyrinth) using devc and matrix Pin
ZurdoDev31-Jan-20 10:48
professionalZurdoDev31-Jan-20 10:48 
QuestionFileSystemWatcher Question Pin
Kevin Marois28-Jan-20 6:07
professionalKevin Marois28-Jan-20 6:07 
AnswerRe: FileSystemWatcher Question Pin
Eddy Vluggen28-Jan-20 7:21
professionalEddy Vluggen28-Jan-20 7:21 
AnswerRe: FileSystemWatcher Question Pin
Gerry Schmitz28-Jan-20 7:57
mveGerry Schmitz28-Jan-20 7:57 
AnswerRe: FileSystemWatcher Question Pin
Luc Pattyn28-Jan-20 10:05
sitebuilderLuc Pattyn28-Jan-20 10:05 
GeneralRe: FileSystemWatcher Question Pin
Gerry Schmitz29-Jan-20 3:38
mveGerry Schmitz29-Jan-20 3:38 

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.