Aashish Singh Negi ...... The Pro

My photo
Mumbai/Rudraprayag, Maharashtra/Uttarakhand, India
Hello Friends, This is Aashish Singh Negi from Mumbai. I natively belong to Uttarakhand. I completed my engineering in Information Technology from Sinhgad Institute,Lonavla Of Pune University. I love Programming......... I know some programming languages like C,C++,Visual Basic,C#,SQL,etc. and work upon various technologies like ASP .NET,Silverlight 3.0,Silverlight 4 Beta, Microsoft Pivot, Photosynth,Deep Zoom, Azure Cloud Computing, etc. I love techno topic very much.Love to watch videos of new technologies(softwares,hardwares,etc) launched by different companies............
Showing posts with label blog. Show all posts
Showing posts with label blog. Show all posts

Monday, July 5, 2010

My HandsOn with Microsoft Pivot ( + Silverlight Viewer )

First of all i would like to thank Twitter because a tweet on twitter about World Cup Pivot inspired and sparked me try my hands on this awesome tool/application from Microsoft - Pivot.

i would like to remind you all of the great saying "a picture speaks a 1000 words .....". My Pivot collection also contains a number of pictures so rather than discussing about what Pivot is all about, i would like you all to visit the Sample Pivot Collection which i created and uploaded to my web server.

My Hands-On ...

You need to have "Pivot Viewer" installed on your computer to view this. The Pivot Viewer is available at http://www.getpivot.com/download/. There is a Silverlight PivotViewer also that is available for download at http://www.silverlight.net/learn/pivotviewer/. To view the Pivot Collection online you just need to have Silverlight Plug-In installed on your machine.

If you have downloaded the normal Pivot Viewer then you can open the "Microsoft Live Labs Pivot" application installed on your machine. After opening the above application you can put the following url to view my Pivot Collection http://pivotapp.aashishnegi.com/Sample.cxml.

If you have Silverlight installed on your machine, you can visit the Silverlight Version of my Pivot Collection at http://slpivot.aashishnegi.com/Default.html.

Now viewing the above links you must have understood that you can view the Pivot Collection by two ways.
  1. Using the Pivot Viewer installed on your machine and getting the url of the .cxml file.
  2. Using the Silverlight Pivot Viewer. I think this is a more better way as it allows me to view the Collection directly through the Browser making use of Silverlight's capabilities.
How was your experience with the Pivot ???

How you can create this ?

Now i will focus some light onto "Pivot" and then explain the simplest steps to create your own Pivot Collection and host it online as i did it.

You can get the details about Pivot at its Official Site.

now rather than discussing the details and introduction of Pivot, i will take you through the simplest steps you can follow to build up your own Pivot Collection. There are many ways to create the Pivot Collections.
  1. Command-Line ( http://www.getpivot.com/developer-info/cmd-line-tools.aspx )
  2. Excel Plug-In ( http://www.getpivot.com/developer-info/excel-tools.aspx )
  3. Just-In Time Pivot Collections ( http://www.getpivot.com/developer-info/jit-tools.aspx )
Here i will discuss the method of developing your Pivot Collection using the "Pivot Collection Tool for Microsoft Excel". You can download the Excel Plug-In from the following link http://www.getpivot.com/developer-info/download-excel-tools.aspx. You need to be online while installing the tool. Run the setup in the Downloaded Package.

After you have installed with the Excel Tool, you can see one more additional tab in your Microsoft Excel's Ribbon Bar. There is "Pivot Collections" tab that gets added. you can see the following picture which shows the tab.


You can see i have specified the Pivot Collections tab in the above image. Click on "New Collection" button on the upper left corner. U will get a new excel book window.

Click on "Import Images" button to select multiple images which you want to upload to the Pivot Collection. The images get added to your Collection. Now what just modify the cell values "Name", "Href", "Description" and you can even insert some new "Facets" - the columns which get displayed inside the "Facet Catagories" on lower left side of the "Pivot Viewer". I added "Place", "Pic Taken By" and "Date" as you can see in following image.


Now you can see the "Quick Preview" of your Pivot by clicking the "Quick Preview" button in the ribbon bar. You wouldn't get to see the images in the "Quick Preview" but you will get see all other characteristics such as Facet Catagories, Facets, Sort DropDown, Filter Panel, Info Panel, etc as shown in following image.


If you are ok with the preview, you are ready to hit "Publish Collection". The excel tool publishes the collection and you get following screen.


After its done with the publishing, you will see your collection opened in the "Pivot Viewer" ....


I did some more changes in the collection. What if i want to add multiple values to a single column. You can do it easily. Just separate the values with "double pipe" i.e. " || ". You can see in following image i created the column named "People" containing the multiple values.


I published it and you can see in following image the "Multiple Values" shown in the "Information Window".



What happens after we Publish the collection ?

After you publish the collection and select the location many of the files get created.

  1. The .cxml file which is an important file which we point and open up in the Pivot Viewer.
  2. A folder with the collection of images and some XML files to handle the images.
If you open the images folder, you will get to see the same architecture and structure as shown by the "Microsoft DeepZoom files" as it works the same way using the "Tile collection" of the images.




The Endnote.

So friends this was my cool experience with "Microsoft Pivot". The "Pivot Collection" i have mentioned in the above example and in the images contained images of size approx "1.5 MB" each. The folder of Images which i added to the collection is about "985 MB". This size of the Images in collection was shrinked to "221 MB". But that was also big n vast in size, so i didn't uploaded this collection to my Web Server.

I created another Pivot Collection to my Web Server which you have viewed through the above links.

I would soon blog about how integrating your Pivot Collection to the Silverlight Application and deploying it to your Local IIS or the WebServer.

Thank You for visiting the Blog.

Please leave your comments to help me improve my blog.

Aashish Singh Negi
aashish.negi@sitgeeks.com

Saturday, January 9, 2010

Silverlight 4 Beta - Playing with WebCam, Printing Support

First of all i should thank a bunch of people who helped me in creating this application.

You can view the Silverlight 4 application i created at http://testing.aashishnegi.com/Default.html. You should have a WebCam on your machine and the machine should be installed with Silverlight 4 Developer Runtime. It will not work in silverlight3 plug-in nor the plug-in will get updated through the popup it displays. You should manually download and install the SL4 Runtime from Silverlight.net.
Now i will briefly discuss about the project and how you can have a little modifications and try out various new things.
Lets start with a preview of how the screen looks and the controls i placed on the screen.



  • WebCam & Mic Support: Lets start and see how we can add the webcam support to the application.
CaptureSource provides us with the methods that work with specific audio or video capture from the associated capture device.






After the CaptureSource is initialized, VideoCaptureDevice can be used to to get the default device configuration. CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice() provides it with the default configures video device. If you right click on Silverlight App and select the Silverlight Plug-in then under the WebCam/Mic tab, we can select and set the default device.

After this the CaptureSource we created above can be used to control the camera. The CaptureSource.Start() and CaptureSource.Stop() will start and stop the cam. As the use of Cam requires user intervention the methods CaptureDeviceConfiguration.AllowedDeviceAccess  and the function CaptureDeviceConfiguration.RequestDeviceAccess() provides user with following dialog box for access request.








In above code the “viewer” is a rectangle that is filled with the brush “VideoBrush” to display the captured input of device.


Clicking Of Pic is something i felt a bit difficult and i referred Vikram’s Blog for understanding this. Following is the code bit for it.





AsyncCaptureImage() can be used to click a snap from the CaptureSource. The Image img is used to add the image to the list box after it is clicked.
  • Saving the image as PNG: This section will tell how to save the image we clicked. For this you can refer the following bit of code. .NET Image Tools Library is used in following code lines. .NET Image Tools made it very easy.






  • Printing Support: Lets see how we can print something using Silverlight 4 printing support.




Here we can see that PrintDocument class provides printing capabilities for a Silverlight application. As in above code we can see i initialized the PrintDocument and initiated a EventHandler which checks for when the PrintingPage event occurs. Print() can be used to show a Print dialog box.

The PageVisual property is used to choose what elements or rather UIElements we need to print.The PrintableArea defines the area to be printed. HasMorePages represents whether there are more pages to print. Its a bool that returns true if there are more pages to print.

StartPrint can be used if we need to perform some special handling or set up before beginning the printing. The EndPrint event can be used to perform cleanup operations after printing is complete or to detect errors that occured during the printing process. EndPrintEventArgs.Error property will give out the error occured.
  • I am currently working with the other new features of Silverlight 4 Beta like Out-of-browser Network Support, Drag and Drop + ClipBoard support, WCF RIA, RightClick support, etc. I will soon blog about these too.

  • Thank You all for visiting my blog.

- Aashish Singh Negi
Twitter @aashishnegi
Phone: +919970141082