Image processing applications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Miss Tan
    New Member
    • Dec 2010
    • 2

    Image processing applications

    I'm having some problems with the coding I found online. Currently I'm doing the cropping application on an image by using C#. I encounter many errors when debugging. Here's my codes,

    private void cropToolStripMe nuItem_Click(ob ject sender, EventArgs e) //start typing code after double clicking on windows form1

    public partial class CropForm : Form
    {

    public CropForm()
    {
    InitializeCompo nent();
    btnOK.DialogRes ult = DialogResult.OK ;
    btnCancel.Dialo gResult = DialogResult.Ca ncel;
    }


    public int CropXPosition
    {
    get
    {
    if (string.IsNullO rEmpty(txtX.Tex t))
    txtX.Text = "0";
    return Convert.ToInt32 (txtX.Text);
    }
    set { txtX.Text = value.ToString( ); }
    }

    public int CropYPosition
    {
    get
    {
    if (string.IsNullO rEmpty(txtY.Tex t))
    txtY.Text = "0";
    return Convert.ToInt32 (txtY.Text);
    }
    set { txtY.Text = value.ToString( ); }
    }

    public int CropWidth
    {
    get
    {
    if (string.IsNullO rEmpty(txtWidth .Text))
    txtWidth.Text = "0";
    return Convert.ToInt32 (txtWidth.Text) ;
    }
    set { txtWidth.Text = value.ToString( ); }
    }

    public int CropHeight
    {
    get
    {
    if (string.IsNullO rEmpty(txtHeigh t.Text))
    txtHeight.Text = "0";
    return Convert.ToInt32 (txtHeight.Text );
    }
    set { txtHeight.Text = value.ToString( ); }
    }
    }
    }

    Please help and do correct me. Thank you.
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    In the future, please put your code in CODE tags. You can do this by highlighting the appropriate text and clicking the "#" button in the editor.

    Can you please be more descriptive of what the problem is? Looking at the code all you have there is is get-set properties defined. Where are you trying the actual crop? I copied and pasted what you wrote in and it compiles fine.

    Please elaborate further on what the problem is.

    Comment

    • Miss Tan
      New Member
      • Dec 2010
      • 2

      #3
      The errors I encountered when coding the crop application after double clicking on the 'Form1' was 'btnOK, txtX,txtY' and so on does not exist in current context. What does that suppose to mean? What does it mean by current context? Please help. Thank you.

      Comment

      Working...