Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 803073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:42:03+00:00 2026-05-14T23:42:03+00:00

When I am trying to create image like Image<Gray, Byte> testImage = new Image<Gray,

  • 0

When I am trying to create image like

  Image<Gray, Byte> testImage = new Image<Gray, Byte>("david.jpg");

When compiling it gaves An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dllexception.
But if I use

  DialogResult result = openFileDialog1.ShowDialog();
        if (result == DialogResult.OK || result == DialogResult.Yes)
        {
            textBox1.Text = openFileDialog1.FileName;
        }

        Image<Gray, Byte> testImage = new Image<Gray, Byte>( textBox1.Text);

It works.Problem is that it cant find path? I am adding all .jpg files in project folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:42:03+00:00Added an answer on May 14, 2026 at 11:42 pm

    This is most likely because the image (“david.jpg”) can’t be found. There are two ways around this if you will always be using the image.

    1/ Use the full file path (“C:\Main_Directory\Sub_Directory\David.jpg”)

    2/ If you wish to use just (“david.jpg”)

    Right Click on your project in the ‘Solution Explorer’ panel, (as you would add a new form or reference) select Add>Existing Item

    Browse and locate your Image (Note:You may have to change what file type your looking for in the drop down box below object name. Once selected click Add.

    In your ‘Solution Explorer’ panel you should have the image now in your project. Now the IMPORTANT step as you did with the OpenCV librarys (cv210.dll, cxcore210.dll etc) You must select the image and in the ‘Properties’ panel change the ‘Copy to Output Directory’ to either “copy if newer” or “copy always”.

    This should solve your problem if you are always going to use the image I would suggest option 2 as when you export the program to another user the image will be copied to the bin\deploy directory

    Hope This helps

    Chris

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a menu that looks like the image linked. (https://i.stack.imgur.com/BCiqJ.jpg).
I am trying to figure out how to create an image gallery like the
I'm trying to create a navigation bar in html+css that looks like the image
I am trying to create a tree like node diagram, like the example image
I'm trying to create a JPG from part of my WPF Applications. Like a
I am trying to create network map on c# like on this image I
I am trying to create an indoor map like the below image.This is scrollable/moving
I'm trying to create a embossed effect on an image (like a polaroid). so
I am trying to create a new Image from raw data in unsigned char
I am trying to create input text like below Image : First I used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.