views:

94

answers:

5

Hi this question or problem i have its very hard i have search and ask in the university and i have no idea how to make this happen, or even if it is possible.

Here we go... I am making a photo or image editor with the variation of letting the user to insert buttons in top of the edited image(this buttons when clicked plays an audio file) all of this works so far. BUT at the end when the user finish his work i need him to save it, so it can be send and view by others.
Now I think I know how to save an edited image but that dose not contain the buttons (controls) .... its like when we save a file at power point and we send it to others they contain audio and the image. Hope fully you guys understand if so can any one point me in a direction to do this or show me how if possible.

( Some people told me to use meta-data others the manifest file but I am so confuse). too bad i cant post pictures of the work until i get 10 points...... Thanks For the first four quick response and sorry mistake of not telling that I am working on C# 3.5 .Net and in Windows Form app.
It seems you all quite understand what i am trying to do here. I will post the picture thanks to the points i receive from TheVillageIdiot. and about the XML I have never ever used that before ill try my best to understand you guys but if any one can show me an example two or were to read ( dose xml works on Windows form app.?) alt text Here is ...( sorry if the picture its too big) an example of what the program it's doing so far that black transparent box its the MouseOverBackColor... when clicked it loads a player that plays x_x the sound. Its like tagging but with audio.

I really need help i reached my limit don't know were to look and the time is killing me.


HI I am back again this time with a simple sample of what i need to learn how to save the dinamic buttonarray Today is 10/11/10 (i made a acount with !@#$%share to share the sample with you guys i hope this dosent bother any one here) here is the Link . i will explain again what i need to do and i have no idea or code on how to do it.Imagine a person that uses the program and create like 5 buttons any were in the form , it needs to be save so he can send it to others that have the same program, this way others can view the buttons the user created. hopefully you guys can help me out with a simple example i really neeed some sample working code. Note: I am working on windows form app WFA C# 3.5 .net M.V.studio2010 (the file I gave above has a backup with a 2008 vercion) thanx in advance.

+1  A: 

One solution: Create a ZIP file that contains both audio and images.

jm
As a side note, this is how Office 2007 and above works. All of the files (docx, xlsx, pptx, etc) are zip archives that contain all of the files necessary to create the document. Just change the extension on one of those files to .zip and you'll see what I mean.
Chris Lively
WOW lol that's very cool and interesting Chris .... but can you help me a little bit more i posted a very simple sample of a project. any ways ill keep reading now ill search for how to create a zip file. ill keep you all posted.
Bloodsville
A: 

Basically, you've got two things you want to save.

The edited image, and then the locations of the buttons and their actions.

You've got the image-saving part happening, so now you need to save the other information. This can be considered "metadata", and you can save it in some format that you invent, such that it allows you to load it back. Typically it would be easiest to do this via XML Serialization. So look into that.

Noon Silk
+1  A: 

Similar to jim's answer, I would suggest having an archive of some sort (ZIP or otherwise) containing all the media necessary.

Store the images and sounds files by name or checksum in the archive and keep the meta-data (button positions, names, what media they use, etc, we'll call it the definition file) in a file also stored in the archive. You may be able to use XML to make that human-readable.

The entire package will then be simple to distribute and use, as everything will be contained in the archive. Your application simply needs to scan for archives, check each archive for a valid definition file, and load the ones that are needed.

Edit: Going from the screenshot you posted and my understanding of the problem, I'm going to suggest the following:

When a user creates a button (defined as a rectangular area or "hotspot"), open a dialogue asking for a sound file to associate. Then, store the top-left and bottom-right corners of the button and the filename in a XML file, something like this:

<Button name="myButton!">
    <Position top="128" left="128" />
    <Size height="200" width="200" />
    <Audio filename="something.mp3" />
</Button>

Now, when compiling a plugin, create a ZIP archive. Inside, place the XML file and all the audio files you need.

When loading a plugin, read the XML file first and find the audio file (assume all audio files are in the same archive as the XML file). Then create the button and add the audio filename as, say, its Tag property. Assign all buttons one generic OnClick event, and in the OnClick event, play the audio file given by the current object's Tag.

If you don't understand what I mean, I'll try to elaborate further. I think that method should work neatly and be pretty simple to work with. :)

peachykeen
Hello @peachykeen and the others I have read a lot lately about serialization and that is the way to go. Now I know about xml, binary and SOAP serialization. after learning i came back to reread all your answers every one had a good understanding thanks. but every thing you said above its exactly whats needs to be done EXACTLY! I do not see any other way, so ill be saving the image and additional information(text) in a xml file (my own format) and save the audio files to that same folder (already done) IF you are around Please post something say hi or something.
Bloodsville
Are you planning to actually save the image itself in the XML? That may be a bit of a bother, since you'll have to base64 encode it. You'd probably be better off saving it as a separate file, since you're doing that with the audio anyway.
peachykeen
A: 

Assuming you are writing a stand-alone application and no web - application.

If you are adding the Button as a .NET component (new Button()) there is no way to do that unless you supply your own player software with it.

If you want to supply your own player, create a (seperate) file with the info about the button and read the file and then re-create the button. (Be aware though that all the resources - jpeg, mp3) also have to be available at the target PC) Alternatively, pack all you info into one file (jpeg, button infos, mp3's) and save that file.

hth

Mario

Mario The Spoon
A: 

You have two choices

  1. Create your own format and then make a player app that read it and play the results
  2. Find some format that supports your features and create that kind of file. This works well if you expect others to have a player.

For #2, here are some formats that could support what you want to do

  1. Flash
  2. PDF
  3. Compiled HTML Arhive -- need IE to play http://en.wikipedia.org/wiki/MHTML
  4. EXE -- create code with resources and compile it -- basically your player + resources
  5. PowerPoint
Lou Franco
I think, in this case, using a known archive format would be better than a special-purpose format. I'd say that ZIP might be easier to work with than the ones you've listed (in general, being just an archive format), and would probably be more flexible. All five of your #2 suggestions are totally valid, they might just be overkill or awkward for this.
peachykeen
The ones I picked have players that can "play" his interaction. Meaning -- they all have a way of representing an image with a hotspot that plays a sound. No zip client will understand how to do this.
Lou Franco
Lou Franco You got the idea creating my own format and then use the same app that make it (the file) to read it was the idea or first idea i had .... but i have no idea on how to get there ... meanwhile I am making the app with the and all the controls etc.
Bloodsville