Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

dizzyJ

@dizzyJ
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Compare picturebox.image with image from a resource file
    D dizzyJ

    It didn't work, but I will find another way to do it. Thank you for all your help.

    C# question tutorial learning

  • Compare picturebox.image with image from a resource file
    D dizzyJ

    We tried that but,

    bild.Image.Save(ms1, System.Drawing.Imaging.ImageFormat.MemoryBmp);

    Returns an ArgumentNullException. "Value cannot be null, parameter name: encoder". I guess the MemoryBmp ImageFormat is null or something. Didn't you get this exception?

    C# question tutorial learning

  • Compare picturebox.image with image from a resource file
    D dizzyJ

    Didn't work! This is what I got from your code example. "Tarning1" is one picture in the resource file. "bild" is the picture box name.

    System.IO.MemoryStream ms1 = new System.IO.MemoryStream();
    Bitmap pic1 = new Bitmap(bild.Image);
    pic1.Save(ms1, System.Drawing.Imaging.ImageFormat.Jpeg);
    byte[] byteArray1 = ms1.ToArray();

    System.IO.MemoryStream ms2 = new System.IO.MemoryStream();
    Bitmap pic2 = DicePictures.Tarning1;
    pic2.Save(ms2, System.Drawing.Imaging.ImageFormat.Jpeg);
    byte[] byteArray2 = ms2.ToArray();

    if (byteArray1 == byteArray2)
    Console.WriteLine("Equal");
    else
    Console.WriteLine("Not equal");

    Did I miss something?

    C# question tutorial learning

  • Compare picturebox.image with image from a resource file
    D dizzyJ

    Have already tried, it didn't work =( Thanx anyway

    C# question tutorial learning

  • Compare picturebox.image with image from a resource file
    D dizzyJ

    I have added 4 pictures to a resource file which I want to compare with the image in a picture box An example of what I want to do is:

    if (pictureBox1.Image == resourceFile.Image1)
    {
    pictureBox1.Image = resourceFile.Image2;
    }

    else
    {
    pictureBox1.Image = resourceFile.Image1;
    }

    This code compiles but the else-statement always executes. How do I make this work?

    C# question tutorial learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups