Hello Saadi,
Straight to your questions:
Silverlight has no direct access to the harddrive, so you cannot access information that is on the user's machine.
You have a file-open dialog with which you can ask the user to select image files and only then you will have access to them. Here is more information about the file-open dialog:
http://www.silverlightexamples.net/post/Open-File-Dialog-in-Silverlight.aspx
and about loading images from opened files:
http://impressionsoft.blogspot.com/2008/04/open-file-dialog-in-silverlight-20_26.html
Web service may not be the best way to serve an image, you need to retrieve the images from a database but expose them as a simple url that can be used in Silverlight. Unfortunately I cannot give you much guidance on that.
The example that I send you just "locks" he image while dragging, but wih a bit of maths you can add a delay effect, just replace this code:
//Get where the canvas is located relative to the root: |
var canvasPosition = dropCanvas.TransformToVisual(null).Transform(new Point(0,0)); |
var mousePosition = e.Options.CurrentDragPoint; |
|
//Move the image accordingly: |
Canvas.SetLeft(image, mousePosition.X - canvasPosition.X - image.ActualWidth/2); |
Canvas.SetTop(image, mousePosition.Y - canvasPosition.Y - image.ActualHeight/2); |
|
with whatever you would like to happen (e.g. the image lagging behind your mouse, etc). Using a Storyboard to animate the image is also an option.
Best wishes,
Miroslav
the Telerik team
Check out
Telerik Trainer, the state of the art learning tool for Telerik products.