Taking values from multiple textboxes

and writing to an image file

Page 1 of 1

1 Replies - 818 Views - Last Post: 27 December 2009 - 05:41 AM Rate Topic: -----

#1 MarmiteX1  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 159
  • Joined: 17-October 09

Taking values from multiple textboxes

Posted 24 December 2009 - 01:32 PM

Hi,

I have an PicEditForm. I am currently trying to figure out how I could go about taking values from multiple textboxes and write it to an image. I found out that I cant write the metadata to the same image.

At the moment I can only write one property tag information such as Title at one time. I have created several methods which write specific information. For example the UpdateTitle method writes the Title, Update Keywords writes the Keywords. The various "Update..." methods also outputs an image(someImage.Save(.....)) with the new property item to a directory I specified.

At the moment I have a save button which has the following write method:
UpdateTitle();


This willonly write the title of the image if the user only enters some text into the titleTextBox. But what if a user decides to enter some text into the keywordsTextbox as well and then attempts to save the image?

This will result in only the title being written and not the keywords. So if i go to the directory where the images are created, the image will only have the title written to it.

If I replace the above method with the UpdateKeywords() method then it will write the data to the image providing the user enters some text into the keywordsTextBox and selects the save method. This will output an image with the "new" keyword written to it.

Now I tried to put the UpdateKeywords method after UpdateTitle it but it doesnt work.

What I want to be able to do is allow the user to edit the title and the keywords at the same time and then once the user selects save, only 1 image will be created in the specified output directory which contains the title and keywords that the user just entered.

If the above doesnt make sense then this what I mean:

So if the user only edits the title, an image should be created with only the title.
if the user only decides to edit the keywords then an image should be created with only the keywords.
But if the user edits both title and keywords then an image should be created with the updated title
and keywords.

I am trying to emulate what occurs when you go on image properties in Windows Explorer and edit multiple information of the image, you then select save to save the changes.

I tried using if statements like this as an attempt but its not gonna work:
if(titleTextBox.Modifed == true)
{
   UpdateTitle(); //
}
else if(keyWordsTextBox.Modifed == true)
{
   UpdateKeywords();
}



So anyone could advise please?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Taking values from multiple textboxes

#2 MarmiteX1  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 159
  • Joined: 17-October 09

Re: Taking values from multiple textboxes

Posted 27 December 2009 - 05:41 AM

Update:
Partially working now. Just need to do little bit more and some testing. If anyone has any suggestions could you please share them with me?

Thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1