|
I have embedded in my ASP.NET web page a Silverlight control that uses the Silverlight 4 audio recorder to allow users to record audio remotely through their browser. For now I am capturing the audio in a stream in memory in the Silverlight control on the client side and then, when the recording is complete, my Silverlight control calls a web service hosted by my server to uploading the complete audio 'file'.
This works okay with reasonably small audio recordings, but I need to allow my users to record fairly long audio recordings. The best solution I can think of for this is to have my Silverlight app do some type of streaming upload to the server as the audio is being recorded, so that the Silverlight app doesn't have to save the entire recording in memory and wait for the recording to complete before transmitting it to the server.
Can anyone tell me if this is possible and, if so, what I would need to do to get started streaming the audio as it is being recording in my Silverlight app to the server?
Any help would be greatly appreciated!!
|
|
|
|
|
Silverlight supports sockets. You could store the file in the Isolated storage and upload it via sockets on another thread.
|
|
|
|
|
Hi,
I need to build an image editor that should have all the functionalities of photoshop. The images should be loaded in a repeater or a listview control showing thumbnails. I should be able to drag the thumbnail on to a canvas and be able to edit the image, add layers etc...similar to photoshop and finally print it as a PDF. So far all my efforts to do this have failed. Kindly help me.
I have started developing the application. I have sucessfully loaded a Repeater Control with images...sort of like an image gallery. Now i want to drag those images into a canvas like that of photoshop and be able to add layers and other effects. I am unable to do that. Is there a way to drag items from a Repeater control and is there a way to call Photoshop in a .NET Application??
|
|
|
|
|
You have got the wrong forum.
This is the Silverlight forum.
My signature "sucks" today
|
|
|
|
|
ikbegins wrote: I need to build an image editor that should have all the functionalities of photoshop.
Then you're going to build an app with about ten million lines of code in it? Not meaning to sound sarcastic, but you and what army?
|
|
|
|
|
I got the impression he does not want to reverse engineer PS but use it from a silverlight web application. Drag the image onto a control that opens PS with the image loaded seems a doable solution. I think the OP is possibly struggling with english.
OTOH If he does want to build PS
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey Microft...you got that 100% right. Thats exactly what i wanted to do. Create a Silverlight web application having an image gallery. I should be able to drag images from that gallery and drop it in a canvas and be able to edit the image there. Is there a way to call the photoshop interface somehow and edit the image? I think my english is fine. I am sorry i wasnt clear before. Hey thats the way clients give their requirements! lol.
So is there a way to achieve this?
Regards,
Imran
|
|
|
|
|
ikbegins wrote: Is there a way to call the photoshop interface somehow
Don't know, never used it. I would go pester Adobe, I'm dammed sure they have a support forum and "Photoshop API" might get you something.
Just don't let the client get you to try and embed PS in your web page
I would look at opening PS with the file name, does double clicking on a file open PS if it set as the default editor.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Hi,
I don't understand how i can use viewbox control in Silverlight 3.
I may use Silverlight Toolkit (for SL 3) or Silverlight 3 Controls implements native Viewbox?
When i use this :
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
<controls:viewbox>
It doesn't work :
The tag 'Viewbox' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit'.
Somebody can help me ?
(Note: I use Visual Studio 2010 as the IDE)
Thanks
|
|
|
|
|
To use the viewbox, you need to use xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" .
This is a part of the Silverlight toolkit available here.
My signature "sucks" today
|
|
|
|
|
|
Have you added a reference to the toolkit dll in your project?
My signature "sucks" today
|
|
|
|
|
|
Just uninstall silverlight toolkit and
install it from following path.
I think it has been overridden by older version or
when you installed vs 2010 it may conflicted with the
existing silverlight version.
And close vs 2010 b4 you install silverlight toolkit.
http://silverlight.codeplex.com/[^]
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Viewbox is supported in Silverlight 4 so you cant use it directly in Silverlight 3. If you want to use it in version 3, then you will need to use the Silverlight Toolkit.
-Mamta
|
|
|
|
|
I'm using the Silverlight 4 Tookit Expander all over the place. They are all contained within a ScrollViewer. Sometimes when I expand one of the Expander elements, the Expander.Header winds up above the top of the ScrollViewer and hence is not visible and so you can't see the title of the content that has been expanded. What I would like to do is center the Expander header vertically within the ScrollViewer viewport when I expand the Expander. To do this I have to set the ScrollViewer.VerticalOffset to the right value that will center the Expander in the ScrollViewer viewport.
So I think I understand the problem that needs to be solved. But I haven't found a solution. Hopefully it's simple and I'm just overlooking something.
The only ScrollViewer properties I've found that might be relevant to this problem are the following: ViewportHeight, VerticalOffset, ExtentHeight, and ActualHeight. I also have the mouse cursor Point relative to the Expander when the Expanded event takes place. But even with all this information, I don't seem to have the right information to compute what the VerticalOffset of the ScrollViewer should be.
SOLUTION: Chalk up my inability to solve this to plain and simple User Brain Damage. The solution was SMOP: a Small Matter Of Programming.
Most of the properties I identified above are not needed, only the following: VerticalOffset, ViewportHeight, and the Y coordinate of the mouse cursor position. Oh, yes! You have to perform the computation in the right event: Expander.SizeChanged, not Expander.Expanded. Only perform the offset if Expander.IsExpanded is true.
So the code in my SizeChanged event looks like this:
private void expander_SizeChanged(object sender, SizeChangedEventArgs e)
{
Expander expander = sender as Expander;
if (expander != null && expander.IsExpanded)
{
double viewportHeight = scrollViewer.ViewportHeight;
double verticalOffset = scrollViewer.VerticalOffset;
double mouseVerticalOffset = MouseCursorPosition.Y;
double newVerticalOffset =
verticalOffset - viewportHeight / 2 + mouseVerticalOffset;
scrollViewer.ScrollToVerticalOffset(newVerticalOffset);
}
}
FYI, MouseCursorPosition is one of my properties, set in my ScrollViewer's MouseMove event. Seems kind of expensive, but it doesn't seem to interfere with the UI response and I don't know of any other way to get the mouse cursor position.
|
|
|
|
|
fjparisIII wrote: Only perform the offset if Expander.IsExpanded is true.
Actually I like it better if you center the Expander whether or not it is expanded. Now all I have to do is animate the centering so that it doesn't jump to the middle so violently.
|
|
|
|
|
fjparisIII wrote: Now all I have to do is animate the centering so that it doesn't jump to the middle so violently.
Impossible, at least by using a Storyboard. The only thing you can animate with a Storyboard is a Dependency Property and the ScrollViewer's VerticalOffset property is read-only. Major bummer. Why did they do that???
Googled around a bit and I found two workarounds. First you can write a ScrollViewer extension adding a dependency property implemented using ScrollViewer.ScrollToVerticalOffset(). Second, you can bite the bullet and do it the old-fashioned way: use a DispatcherTimer, which itself would call ScrollToVerticalOffset().
|
|
|
|
|
Did you try setting the VerticalContentAlignment and the VerticalAlignment to stretch for the expander and for the scrollviewer?
My signature "sucks" today
|
|
|
|
|
Abhinav S wrote: Did you try setting the VerticalContentAlignment and the VerticalAlignment to stretch for the expander and for the scrollviewer?
No. What's that supposed to accomplish? The solution I posted works perfectly fine. Besides, I've moved beyond that now and am working on animating the scroll to the center of the viewport, using a DispatcherTimer . I've got it working beautifully, but I had to set the timer interval to 1/120 of a second to get a smooth scroll. 1/60 of a second for some reason produces a jerky scroll.
I've been experimenting with the duration. So far I like a duration of 0.2 seconds, producing 24 intervals. Each interval scrolls 15 vertical pixels within a viewport of 860 pixels (i.e. scrolling a little less than 430 pixels when the Expander is at the top of the viewport). Eminently smooth.
Anyhow, this animation stuff is far more interesting than centering the Expander , which as far as I'm concerned I solved to my satisfaction hours ago.
I'll show my animation code when I've sufficiently polished it. I've created a class to perform the animation, because I have about 100 Expander elements in 12 different classes, so I need to be clean about this.
|
|
|
|
|
fjparisIII wrote: VerticalContentAlignment and the VerticalAlignment to stretch
These are supposed to place a control within another control.
I would suggest you have a look at the documentation (for them) on msdn.
And you would need to set the properties to "center" and not "stretch" as I mentioned above.
I'm glad that you have managed to get this working using a workaround though.
My signature "sucks" today
|
|
|
|
|
Abhinav S wrote: These are supposed to... etc.
I know what they both do. I use them all the time, both in Silverlight and WPF. I just don't see their relevance to the problem I was trying to solve.
Abhinav S wrote: I'm glad that you have managed to get this working using a workaround though.
You're talking about the centering of the Expander s, correct? I'd hardly call my solution a "workaround." It's a straightforward solution, direct and to the point.
Maybe I didn't explain carefully enough what I'm trying to do. I have extensive product documentation on my Website. I have a product overview, ten tutorials, plus an "Easter egg" that gives background on how such a product ever came to be developed. Each document is initially presented as a list of Expander s within a ScrollViewer . The average list has about 8 Expander s and each Expander expands and collapses on average 8 lines of wrapping text per paragraph and maybe 5 or 6 paragraphs.
The problem was to vertically center an Expander header when the user clicks on it. However, doing that was just a matter of SMOP, nothing esoteric about it at all, and I shouldn't even have asked the question to begin with.
But then I immediately saw that the expansion/collapse took place so fast that it was disconcerting and that it needed to be animated. That's really the interesting part of this entire discussion, and I'm still working on it to capture all the end cases. Should have it all worked out sometime this morning, and then I'll present it under Tips and Tricks.
Anyhow, I don't see how VerticalContentAlignment would play a role in this, since I don't want to keep the content vertically aligned, but only vertically aligned when the user clicks on the Expander header, and only the header for that one Expander , not all of them.
|
|
|
|
|
|
Hi again!
As you can guess, i have been learning WPF.
I have a question about data-binding (I currently use Linq2Sql). Everything is OK, as long as I use a simple column-to-textbox or column-to-listbox binding.
1. How to perform a more complex data-binding? I would like to hold a more sophisticated Linq query in the logic/code layer (not in the presentation). I am interested in a two-way binding.
2. How to set a DataSource directly in Xaml? In most of tutorials something like this is proposed:
control.DataSource = _myObservableCollection;
However, if I want to have a data-bound combo box which is inside a DataTemplate of a listbox, it would be ugly to dig into a visual tree just to set a data source of each combo box in each listbox's item.
I know my message is messed, if you have any questions then please ask them (the questions).
Thanks --
Greetings - Jacek
|
|
|
|