Access to clipboard in Silverlight - silverlight

Can I get image from clipboard in Silverlight? How I can do it?

In Silverlight 5, access to clipboard information is limited to Unicode text access. This differs from the WPF implementation of Clipboard, which enables access to other specific types (for example, streams or images) or to data objects.
Details: http://msdn.microsoft.com/en-us/library/system.windows.clipboard(v=vs.95).aspx
This may help you: How to copy image of a chart from Silverlight application to clipboard?

Related

Stretch swf video to fit the player

This should be something that a quick google search should have resolved but thus far has not.
I have an embedded AxShockwaveFlash object that loads a specific swf file. The file responds to commands that are sent it via the CallFunction method on the AxShockwaveObject.
What properties do I need to set in the designer to make the .swf video stretch to fit the AxShockwavePlayer object?
As an example, what I am looking for is behavior similar to this, only in a C# WinForms application and part of the screen will be occupied by controls and components.
You don't set the Flash size via CallFunction, instead define the embed properties width and height.
http://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html
How do you embed the flash object in the HTML?

How to add an image of a Silverlight UiElement to Word Document

I want to add an image of a certain DataGrid in silverlight to a word Document.
I've created a WriteableBitmap of the DataGrid but I can't find how to copy this image to the word document.
It doesn't have to be a WriteableImage. Any solution that works is fine with me.
Thanks.
Not possible as of Silverlight 5.
In Silverlight 5, access to clipboard information is limited to
Unicode text access. This differs from the WPF implementation of
Clipboard, which enables access to other specific types (for example,
streams or images) or to data objects.
See MSDN.

What controls should I use on a Silverlight website for loading textual content?

I am embarking on development of a Silverlight based website. I am the lone developer and am doing it on my own (ie, not for any company).
Now I want to load a lot of textual content on the website along with animations and rich user interfaces that can be created using Silverlight. The text content may change from time to time and when that happens, I don't want to do a lot of rework. So I m thinking to load the text from a Word/text file into controls and whenever new content arrives/existing content is modified, I just have to append it to the Word/text file.
This way the application itself remains untouched, only the file contents keep changing. Silverlight doesn't support FlowDocument. RichTextBox doesnt have a Load or LoadFile property. So how do I go about this? Should I make use of Frame, Downloader and similar other controls as well? What do you suggest? What would be the best approach to this?
The RichTextBox does have a Xaml property so you could download Xaml files containing the restricted set of textual elements that RichTextBox supports. You could also create a Silverlight editor around which you could create and upload this Xaml text content.
However have you considered whether Silverlight is the right platform to deliver primarily textual content? HTML is pretty good at that and with frameworks such as JQuery you can create quite interactive experiences that work well across browsers.

Can Silverlight copy a graphic from the clipboard?

Can a Silverlight application copy a graphic/bitmap from the clipboard? If so, how is this done?
AFAIK there is no direct support for Silverlight clipboard.
If you want clipboard access for text, then probably you need to look at this blog post by Jeff Wilcox
Silverlight manager though admits that there is no clipboard support
Currently there is no way to access image data from the clipboard. You would need to save the data on a clipboard to a file and then load the image from the file via OpenFileDialog.
With Silverlight 4 you make that process ever so slightly slicker by dragging the file onto your silverlight app.
Coming up in Silverlight 4 (hopefully the next beta) there is rumored to be support for image formats on the clipboard. Silverlight 4 supports text on the clipboard and I'm keeping my fngers crossed that it will extent to images by RTM.

Can Silverlight do the following?

Can i do the following in a silverlight page/app? (Note: the silverlight app will be embedded on an ASP.NET MVC website page) :-
Display an image from a resource: eg. www.someDomain.com/image.png
Url of the image to display is passed into the control (ie. it's not hardcoded, but .. say .. entered into a textbox via the user, on the page).
Resize the image.
Add layers to the image. A layer could be .. i donno .. some basic text or another image or icon
change the font or font-size of a layer font.
'Save' the modified image to another url, via an HTTP-POST. So if i've resized the image or added some text-layers these are all rendered into a single bitmap (png/jpg/whatever) which is then POST'ed to a url as binary. (ie. multipart/form-data)
Note:
I've asked this question before but that was for Flash (flv/swf). I'm now interested if this can be done in silverlight.
Updated Question
Also, what software is required to create these silverlight apps? VS2008? Expression blend? I know u can use notepad .. but i'm so new to this I would need some WYSIWYG app, I expect.
The Writable Bitmap API Silverlight 3 sounds pretty much what you're after. You can use the standard Silverlight controls such as TextBlock and Image to lay the image and layers out and then use the API to take a "screenshot" of that layout to upload to a server.
Hope this helps.
Yes it can, but it has similar crossdomain restriction as flash. You'll need a crossdomain.xml or clientaccesspolicy.xml in place on the remote servers to allow silverlight to communicate with them. There is an ms article here which gives some more information on the restrictions on using silverlight to talk to other servers.
Once you have the image then you can manipulate it on the client side using the normal .net libraries for such purposes.
So you might load it with
Bitmap bitmap = new Bitmap(<some stream>);
Graphics g = Graphics.FromImage(bitmap);
and then you can play with it in any way you wish.
g.DrawString("Silverlight image",
new Font("times", 32),
SystemBrushes.WindowText, 0, 0);

Resources