Click here to Skip to main content
15,914,419 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb2-Jun-09 2:28
Feras Mazen Taleb2-Jun-09 2:28 
AnswerRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb2-Jun-09 21:04
Feras Mazen Taleb2-Jun-09 21:04 
GeneralRe: how to animate the button in sequencial mode ? Pin
Feras Mazen Taleb7-Jun-09 3:54
Feras Mazen Taleb7-Jun-09 3:54 
QuestionImage on Button Pin
Member 232448330-May-09 9:11
Member 232448330-May-09 9:11 
AnswerRe: Image on Button Pin
ABitSmart30-May-09 16:51
ABitSmart30-May-09 16:51 
AnswerRe: Image on Button Pin
Mark Salsbery31-May-09 8:14
Mark Salsbery31-May-09 8:14 
QuestionProblem executing BitmapDecoder.Save() in worker thread [modified] Pin
fjparisIII30-May-09 8:50
fjparisIII30-May-09 8:50 
AnswerRe: Problem executing BitmapDecoder.Save() in worker thread (solved through egregious kludge) Pin
fjparisIII30-May-09 12:38
fjparisIII30-May-09 12:38 
I still have no idea why BitmapEncoder.Save() fails in a worker thread. I needed to move on, so I've just given up on that problem and took an "end around." I would still appreciate it if someone could explain how to attack the problem head on.

What I did was create a result code in the worker thread that indicates that BitmapEncoder.Save() needs to be called and that is bound to fail in a worker thread and so the worker thread doesn't even try. Instead it tells the UI thread, "I can't do it, you do it," which instructs the UI thread to call that function from itself. It also sets a flag that the worker thread can test to see if the UI thread is busy doing this nonsense and loops on a Thread.Sleep(0) until the flag is reset. Otherwise, the worker thread can get ahead of the UI thread and cause an access violation. The Sleep causes the progress bar to be a slightly jerky, so it would still be nice to eliminate the root cause of this problem and let me call BitmapEncoder.Save() where it should be called, in the worker thread.

This is such a kludge that it is difficult to document it and I wish I didn't have to do it. But I've been hung up on this problem for about three weeks and I'm just sick of it. In fact, I'm ecstatic that I've found any solution at all that lets me run a worker thread so I can have a reactive progress bar that can be interrupted instantly with the click of a Cancel button.

It's amazing that thousand page books can be written on WPF that barely scratch the surface.
AnswerRe: Problem executing BitmapDecoder.Save() in worker thread [modified] Pin
Mark Salsbery31-May-09 8:30
Mark Salsbery31-May-09 8:30 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 11:42
fjparisIII31-May-09 11:42 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery31-May-09 12:26
Mark Salsbery31-May-09 12:26 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 13:50
fjparisIII31-May-09 13:50 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII31-May-09 18:46
fjparisIII31-May-09 18:46 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery31-May-09 20:18
Mark Salsbery31-May-09 20:18 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII1-Jun-09 5:42
fjparisIII1-Jun-09 5:42 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 6:47
Mark Salsbery1-Jun-09 6:47 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
fjparisIII1-Jun-09 8:52
fjparisIII1-Jun-09 8:52 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 10:39
Mark Salsbery1-Jun-09 10:39 
General[Message Deleted] Pin
fjparisIII1-Jun-09 13:34
fjparisIII1-Jun-09 13:34 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 13:46
Mark Salsbery1-Jun-09 13:46 
General[Message Deleted] Pin
fjparisIII1-Jun-09 14:23
fjparisIII1-Jun-09 14:23 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 14:33
Mark Salsbery1-Jun-09 14:33 
General[Message Deleted] Pin
fjparisIII1-Jun-09 14:43
fjparisIII1-Jun-09 14:43 
GeneralRe: Problem executing BitmapDecoder.Save() in worker thread Pin
Mark Salsbery1-Jun-09 15:23
Mark Salsbery1-Jun-09 15:23 
General[Message Deleted] Pin
fjparisIII1-Jun-09 16:05
fjparisIII1-Jun-09 16:05 

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.