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
  1. Home
  2. General Programming
  3. Windows Forms
  4. Winforms - automated retrieve static image

Winforms - automated retrieve static image

Scheduled Pinned Locked Moved Windows Forms
csharpwinformsgraphicsjsonhelp
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fincity
    wrote on last edited by
    #1

    Hello All, I haven't coded a lot in Winforms C#. In any case I need to fetch a temporary stored image image from the local disk and process in a vendors API. Their method requires Bitmap bitmap for the parameters as indicated here(//vendor.Reader.AnalyzeField(Bitmap bitmap)). // Example 1 - This works when I use hard coded texted. // Example 2 fails attempting to use with the variable. The error is "Parameter is not valid". 1 - Bitmap btm = new Bitmap "C:\\Images\\2.tif"); // The variable fails here. 2 - Bitmap btm = new Bitmap(_transferFile); //Perform recognition result = vendor.Reader.AnalyzeField(btm); Thanks in advance

    L 2 Replies Last reply
    0
    • F fincity

      Hello All, I haven't coded a lot in Winforms C#. In any case I need to fetch a temporary stored image image from the local disk and process in a vendors API. Their method requires Bitmap bitmap for the parameters as indicated here(//vendor.Reader.AnalyzeField(Bitmap bitmap)). // Example 1 - This works when I use hard coded texted. // Example 2 fails attempting to use with the variable. The error is "Parameter is not valid". 1 - Bitmap btm = new Bitmap "C:\\Images\\2.tif"); // The variable fails here. 2 - Bitmap btm = new Bitmap(_transferFile); //Perform recognition result = vendor.Reader.AnalyzeField(btm); Thanks in advance

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      fincity wrote:

      The error is "Parameter is not valid".

      Then you need to use a parameter that is valid, i.e. a Bitmap as specified in the method definition. You have not specified what type _transferFile is, but I assume it is not a Bitmap.

      Use the best guess

      1 Reply Last reply
      0
      • F fincity

        Hello All, I haven't coded a lot in Winforms C#. In any case I need to fetch a temporary stored image image from the local disk and process in a vendors API. Their method requires Bitmap bitmap for the parameters as indicated here(//vendor.Reader.AnalyzeField(Bitmap bitmap)). // Example 1 - This works when I use hard coded texted. // Example 2 fails attempting to use with the variable. The error is "Parameter is not valid". 1 - Bitmap btm = new Bitmap "C:\\Images\\2.tif"); // The variable fails here. 2 - Bitmap btm = new Bitmap(_transferFile); //Perform recognition result = vendor.Reader.AnalyzeField(btm); Thanks in advance

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        You mean something similar to below code?

        string fileName = "C:\\Images\\2.tif";
        Bitmap btm = new Bitmap(fileName);

        //Perform recognition
        result = vendor.Reader.AnalyzeField(btm);

        Where is the initialization-code of your _transferFile member?

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

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