Skip to main content

Microsoft Silverlight

Unanswered Question Silverlight deep zoom image click issueRSS Feed

(0)

George1231
George1231

Member

Member

11 points

131 Posts

Silverlight deep zoom image click issue

Hello everyone,

I am using deep zoom composer to generate XAP and html files and they works fine for me. Currently, I want to retrieve the information about which image the end user is clicked, and I want to display the description information for the user clicked image in another Silverlight TextBox control on the same page. The description informaiton is currently stored in a database, and has WCF interface. So, I need to know which image in the whole deep zoom area is clicked (support I have 100 images, 10 images in a row and 10 rows).

Any reference samples or documents? I am using Silverlight 2.0 + VSTS 2008 + .Net + C# + IIS 7.0 on Windows Vista x86 Enterprise.

 

thanks in advance,

George

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Silverlight deep zoom image click issue

Hey you can store image metadata in xml generated by Deep Zoom composer for you.

Go to "GeneratedImages" folder and see there is one file called

Metadata.xml. you can open it and add information about images in <Tag>.

see here:

http://vdcruijsen.net/post/Display-Picture-Metadata-in-your-Silverlight-20-Deepzoom-Application.aspx

There is also source code for the example there.

 

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Silverlight deep zoom image click issue

Thanks Jay! You are always giving valuable advice. :-)

I followed the steps in the blog, it mentioned when I export, I need to check the "Create Collection" checkbox. But actually the Deep Zoom Composer I am using does not have such option for export process. Here is my screen snapshot, any ideas what is wrong?

http://i42.tinypic.com/2zrn5fq.jpg

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Silverlight deep zoom image click issue

The blog entry posted on April 30, 2008, so It has old version of Deep Zoom than yours. You are using latest one. and You are going in right way as in your screen shot, I saw that you've checked the right option button "Export as Collection (Multiple Images)".

If you notice, you will have small dropdown after this option and there you can have "Tag Browser" option there. Select that and export. You will see what you want.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Silverlight deep zoom image click issue

Thanks Jay, 1. do you mean my current settings are already correct? 2. For the dropdown box you mentioned, I can select Default and Tag Browser, as you mentioned I should select Tag Browser, correct? 3. What is the differences between Default and Tag Browser?

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Silverlight deep zoom image click issue

1.Correct 2. Correct

3. You need to see yourself by trying both option one by one i.e. Default and Tag Browser. You will understand then.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay, I have tried and when I select Tag Browser, seems only a lot of XML files are exported and no XAP/html files exported, here is my screen snapshot,

http://i43.tinypic.com/14t5wjs.jpg

Is that expected? My confusion is, if no XAP file generated, how could end user play with the Deep Zoom application -- Silverlight player in browser needs an XAP file to begin play with.

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Silverlight deep zoom image click issue

While selecting Tag Browser, you should have missed selecting "Silverlight Deep Zoom" in output type that you have first selected while doing with Default option.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay, I have tried and it will filter images by Tags automatically, looks cool!

1. My problem is how to check which image is clicked so that I display related description information. Why I should I use Tag Browser other than using Default? (my confusion is I think Tag Browser is a good feature, but not related to my image position issue.) Any comments?

2. I met with build error in the source code attached with the blog, any ideas what is wrong? I am using VSTS 2008 SP1.

Here is what I download => http://cid-ef12210979e9f6b0.skydrive.live.com/self.aspx/Projects/VdCruijsen.SLDeepZoom.zip

Error 1 The best overloaded method match for 'System.Windows.Media.Animation.Storyboard.SetTargetProperty(System.Windows.Media.Animation.Timeline, System.Windows.PropertyPath)' has some invalid arguments C:\Test\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\Page.xaml.cs 244 25 VdCruijsen.SLDeepZoom
Error 2 Argument '2': cannot convert from 'string' to 'System.Windows.PropertyPath' C:\Test\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\Page.xaml.cs 244 69 VdCruijsen.SLDeepZoom
Error 3 No overload for method 'Add' takes '1' arguments C:\Test\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\VdCruijsen.SLDeepZoom\Page.xaml.cs 247 25 VdCruijsen.SLDeepZoom

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

You should open MetaData.xml and add your Description Information there. I don't understand why you need to handle Click event on image and display information when it is already done by Deep Zoom composer for you? You simply put information about MetaData.xml in for each image and Deep zoom will take care of fetching this information upon click of that image. see example here:
(Here when you mouse over the image, the appropriate description is shown at right)
http://deepzoompublisher.com/ClientBin/DeepZoomMetadataTestPageRC0.html

here is the source code to this example:

http://www.kirupa.com/silverlight/Source/Deep%20Zoom%20Tag%20Project%20Updated.zip

Download from above and see their code to implement your application.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay, 1. the reaosn why I want to keep track of which image is clicked is, I am developing a commodity show Deep Zoom, and I need to know which commodity is selected (double clicked) by end user and I will record which commodity is selected and put into the shopping cart. Any comments? :-)

2. Any ideas what is wrong with my build error?

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

For your need, Deep Zoom is not good. On double click, it will zoom in, so what about your double click? Still if you want to go for it, you should read and try according to my previous post.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay,

1. I like this Demo you recommended very much (as below shows), are there any any step by step guide about how to implement this?

http://deepzoompublisher.com/ClientBin/DeepZoomMetadataTestPageRC0.html

2. I agree with you capturing double click is not very good of useability. For my requirements (a lot of commodities, have to use deep zoom to show them in a fancy way, and need shopping cart feature), any suggestions for my solution with good usability?

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Hi Jay, I setup and studied the sample you mentioned, and I like it very much. One question, I found my exported images never shows information like Description/Tags on the right bottom part of the page (as the online Demo shows), any ideas what is wrong? Do I need any additional steps?

BTW: I read through code, but never find related parts of code which handles how to display the right bottom corner.

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

hmm.. let me see. I will post answer here soon..

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Well, I got the answer.

visit here:

http://stackoverflow.com/questions/415036/how-do-i-associate-metadata-with-a-deepzoom-subimage

Here guy shows step by step how can you add additional metadata like Description, Title etc in Metadata.xml and modify the sample project accordingly...

Now you can mark some of my post as answer..Wink  let me know if any....

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

To be more specific, you need to see in Page.xaml.cs in

xmlClient_DownloadStringCompleted method to modify code for that right bottom bar kind thing.

after this line...

string tag = g.Element("Tag").Value;

                    if (tag == "")
                    {
                        tag = "None";
                    }

And put that

string descriptionString = g.Element("Description").Value;
string titleString = g.Element("Title").Value;
kind of code as suggested at bottom in the page in my previous link. 


Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay, the information you provoided is very good, but one of my questions is still not answered, i.e. how to know which picture is selected (when mouse stops on the picture)? I need to know which picture the cursor is located on in order to display the related meta data on the panel.

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Hey the previous post of mine did not solve that issue?

Well, If you have prepared the metadata properly as described in Metadata.xml file as said in earlier post than on MouseEnter event, the panel will display metadata for sure.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

if you still have doubt, I will create simple demo application and post it here.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

George1231
George1231

Member

Member

11 points

131 Posts

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Silverlight deep zoom image click issue

Thanks Jay, I think your previous reply does not answer my question, i.e. how to detect which picture the mouse is on, and I need such information to display the related meta data information. Appreciate if you could share more details.

BTW: your previous reply answers how to retrieve meta data, my current question is how to detect which picture mouse is on, so that I can use the retrieved meta data for that picture to display somewhere.

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15884 points

1,541 Posts

Re: Silverlight deep zoom image click issue

Hi George,

I wrote a Helper method to determine which subimage has been clicked in MultiScaleImage, please have a look.

http://silverlight.net/forums/p/99129/228778.aspx#228778

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

George1231
George1231

Member

Member

11 points

131 Posts

Re: Silverlight deep zoom image click issue

Thanks Mog Liang, I read your code posted here, http://silverlight.net/forums/p/99129/228778.aspx#228778

I like the code you wrote, still one technical issue left, and it is about ViewportOrigin property of MultiScaleImage. My confusion is about the value/range of ViewportOrigin. I think the value of ViewportOrigin should be represented in logical form, so, it should be between 0 and 1, but from the MSDN sample,

http://msdn.microsoft.com/en-us/library/system.windows.controls.multiscaleimage.viewportorigin(VS.95).aspx

the ViewportOrigin could be beyond the range of 0 and 1, like -2, -1.3, etc. Appreciate if you could clarify what is the value range/meaning of ViewportOrigin.

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15884 points

1,541 Posts

Re: Silverlight deep zoom image click issue

Hi George1231,

ViewportOrgin = - (image position relative to left top corner of multiscaleimage control) / (current image size)

We can still see the image in window area when it has been zoomed out to small size (viewportwidth>1) and viewportorigin<-1.

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

George1231
George1231

Member

Member

11 points

131 Posts

Re: Silverlight deep zoom image click issue

Thanks for your reply, Mog Liang. For 1. "image position relative to left top corner of multiscaleimage control", I think it should be in the logical coordinate, so the value of "image position relative to left top corner of multiscaleimage control" will range from 0 to 1? 2. "current image size" -- how do we measure the value of image size? Using logical coordinate to represent size? Or using viewportwidth to represent size? Or?

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15884 points

1,541 Posts

Re: Silverlight deep zoom image click issue

Mog:

ViewportOrgin = - (image position relative to left top corner of multiscaleimage control) / (current image size)

I mean, (image position relative to left top corner of multiscaleimage control) is element position, (current image size) is element size. however if we use logical value both on position and size, the equation is also true.

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

George1231
George1231

Member

Member

11 points

131 Posts

Re: Silverlight deep zoom image click issue

Thanks Mog Liang for your clarification, in the MSDN sample below (for the specific sample of ViewportOrigin="-2, -2" and ViewportWidth is "4", the sample is in the 2nd one of the 2nd row in the samples of the page), what is the value of the "current image size" and "image position relative to left top corner of multiscaleimage control" in your formula so that we could get ViewportOrigin="-2, -2"? I am still confused how to calculate ViewportOrgin because I do not know how to get the values (in logical coordinate form) of "image position relative to left top corner of multiscaleimage control" and "current image size". Appreciate if you could give me some more descriptions. Sorry for my stupid. :-)

http://msdn.microsoft.com/en-us/library/system.windows.controls.multiscaleimage.viewportorigin(VS.95).aspx

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities