Click here to Skip to main content
15,916,702 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Have had troubles with WCF in Silverlight for two weeks Help!!! Pin
Mark Salsbery15-Aug-09 5:55
Mark Salsbery15-Aug-09 5:55 
GeneralRe: Have had troubles with WCF in Silverlight for two weeks Help!!! Pin
Adam Maras14-Aug-09 21:46
Adam Maras14-Aug-09 21:46 
QuestionWindowState.Maximized -- How to get the proper size of the window? [modified] Pin
Cristoff13-Aug-09 22:01
Cristoff13-Aug-09 22:01 
QuestionWPF Expander Control Template Modification Pin
Kunal Chowdhury «IN»13-Aug-09 20:47
professionalKunal Chowdhury «IN»13-Aug-09 20:47 
AnswerRe: WPF Expander Control Template Modification Pin
Mark Salsbery14-Aug-09 6:28
Mark Salsbery14-Aug-09 6:28 
QuestionUpload large files Pin
Tarun.Suneja12-Aug-09 20:34
Tarun.Suneja12-Aug-09 20:34 
AnswerRe: Upload large files Pin
Pete O'Hanlon12-Aug-09 22:01
mvePete O'Hanlon12-Aug-09 22:01 
GeneralRe: Upload large files Pin
Tarun.Suneja13-Aug-09 0:59
Tarun.Suneja13-Aug-09 0:59 
QuestionAnnouncing MoXAML Power Toys 2.5 Pin
Pete O'Hanlon12-Aug-09 11:34
mvePete O'Hanlon12-Aug-09 11:34 
AnswerRe: Announcing MoXAML Power Toys 2.5 Pin
Kunal Chowdhury «IN»13-Aug-09 21:08
professionalKunal Chowdhury «IN»13-Aug-09 21:08 
QuestionControlling the ObservableCollection rendering Pin
guy181212-Aug-09 10:40
guy181212-Aug-09 10:40 
AnswerRe: Controlling the ObservableCollection rendering Pin
Kunal Chowdhury «IN»14-Aug-09 0:53
professionalKunal Chowdhury «IN»14-Aug-09 0:53 
AnswerRe: Controlling the ObservableCollection rendering Pin
Pete O'Hanlon14-Aug-09 1:13
mvePete O'Hanlon14-Aug-09 1:13 
QuestionSilverlight - VectrolLight Tree View Pin
Rajeev Raina12-Aug-09 4:01
Rajeev Raina12-Aug-09 4:01 
AnswerRe: Silverlight - VectrolLight Tree View Pin
Pete O'Hanlon14-Aug-09 4:18
mvePete O'Hanlon14-Aug-09 4:18 
AnswerRe: Silverlight - VectrolLight Tree View Pin
Michael Sync14-Aug-09 4:18
Michael Sync14-Aug-09 4:18 
GeneralRe: Silverlight - VectrolLight Tree View Pin
Pete O'Hanlon14-Aug-09 4:43
mvePete O'Hanlon14-Aug-09 4:43 
GeneralRe: Silverlight - VectrolLight Tree View Pin
Rajeev Raina16-Aug-09 20:29
Rajeev Raina16-Aug-09 20:29 
QuestionGUI updations on socket callback Pin
JS 200812-Aug-09 1:29
JS 200812-Aug-09 1:29 
AnswerRe: GUI updations on socket callback Pin
Michael Sync12-Aug-09 3:21
Michael Sync12-Aug-09 3:21 
GeneralRe: GUI updations on socket callback Pin
JS 200812-Aug-09 19:11
JS 200812-Aug-09 19:11 
My scenario is like this.

SocketReceiveCallback(object sender, SocketAsyncEventArgs e )
{
// read data from e.Buffer.
if ( dataReceived == TotalDataSize ) // checks of the complete reception of one image
{
// update the GUI using the received data.
System.Diagnostics.Debug.WriteLine( “ received image “ );
Dispatcher.BeginInvoke(new DisplayImageDelgate(DislayImageData), imageData); // imageData is a class containing the received data

}
Else
{
// call socket.receiveAsync() to get next set of data.
}
}


private void DisplayImageData (MyImageData data)
{
if (data.ImageStream != null)
{

BitmapImage bmp = new BitmapImage();
bmp.SetSource(new MemoryStream(data.ImageStream));
myReceivedImageCtrl.Source = bmp; //GUI update should happen at this point.
System.Diagnostics.Debug.WriteLine( “ Draw image “ );

}

}

Please note that my application, there is continues async requests to server ( corresponding to user action ) and server responds with a stream of image data( eg:- 100 images. The application needs to update the GUI immediately after each image is received ( even while the server streams the data). In the above case although the SocketReceiveCallback is getting the data continuously from server, the GUI update happens only after all the data receive is completed( which can take a long time ).
It seems that although the DisplayImage function is invoked using BeginInvoke, the system actually executes the display function at a later stage, causing ‘jumping’ image displays
The debug trace obtained was:-

received image
received image
received image
received image
Draw image
Draw image
Draw image


Instead of the needed

received image
Draw image
received image
Draw image
received image
Draw image


What could be done?
Thanks and Regards
JS
GeneralRe: GUI updations on socket callback Pin
Michael Sync14-Aug-09 4:10
Michael Sync14-Aug-09 4:10 
QuestionCancel rendering of a Control in Wpf Pin
jopiron12-Aug-09 0:25
jopiron12-Aug-09 0:25 
AnswerRe: Cancel rendering of a Control in Wpf Pin
Pete O'Hanlon12-Aug-09 0:37
mvePete O'Hanlon12-Aug-09 0:37 
GeneralRe: Cancel rendering of a Control in Wpf Pin
jopiron12-Aug-09 0:43
jopiron12-Aug-09 0:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.