[RESOLVED] Hide waitcursor when saving image to file - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23

Thread: [RESOLVED] Hide waitcursor when saving image to file

  1. #16
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: Hide waitcursor when saving image to file

    Try creating a test app, zip the complete solution and post it here.

  2. #17

    Re: Hide waitcursor when saving image to file

    SaveDelayTestApp.zip

    The attached project is simple - set a timer, start the timer button and watch it save in a folder. Try 10 seconds or more please. Also, you can edit the code for the 'dir' variable to set a local directory you want.

  3. #18

    Re: Hide waitcursor when saving image to file

    I can try AsyncCallback() for now. Another user on MSDN forum posted a solution for it in a WPF setting - he simply uses asynctask and awai - not sure how it cna be implemented in WindowsForm. This is what he says:

    http://social.msdn.microsoft.com/For...=csharpgeneral

  4. #19
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: Hide waitcursor when saving image to file

    Quote Originally Posted by CM2013 View Post
    Another user on MSDN forum posted a solution for it in a WPF setting - he simply uses asynctask and awai - not sure how it cna be implemented in WindowsForm.
    As the other guy said, async is a .Net feature, not a Windows Form feature. Just use .Net 4.0 or above.

  5. #20

    Re: Hide waitcursor when saving image to file

    The .NET version is 4.5 - tried it in WPF and Form - didnt work - had errors. Iam thinking Action<Object> and creatign a new Task.factory.Startnew should work - but that didnt pan out as well. How can Action<Image> saveimg (Image img) function be used?

  6. #21

    Re: Hide waitcursor when saving image to file

    Completed it like this:

    Task t2 = Task.Factory.StartNew(() =>
    {
    pictureBox1.Image.Save(fn, ImageFormat.Jpeg);
    });

    t2.wait() //to block the main thread letting this finish

  7. #22

    Re: [RESOLVED] Hide waitcursor when saving image to file

    NO. It did NOT resolve the issue for longer times - like a timer of 1 minute. Not even ASYNC works as it runs on the CPU anyway at the syetm-level.async Task does NOT work really.

  8. #23

    Re: Hide waitcursor when saving image to file

    Mod, mark it as Unresolved as it isn't.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center