CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    19

    Question Draw and safe an image

    I'd like to use CImage class to paint a picture of 512x512 with random images then save it. I don't know if this is feasible. Someone can tell me how to do this ?

    Thanks
    The color blending is an indication of the underlying prostitution system.

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Draw and safe an image

    CImage image;
    image.Create(512, 512, 32);
    HDC hdc = image.GetDC();
    // Draw to hdc
    image.ReleaseDC();
    image.Save(...);

  3. #3
    Join Date
    Sep 2009
    Posts
    19

    Re: Draw and safe an image

    Thank you

    I have another question

    I'd like to draw that picture and also would want to draw its histogram at the same time. I am thinking about multithreading, but I am not sure I need it

    So is this multithreading or is there a way simpler than that ?
    The color blending is an indication of the underlying prostitution system.

  4. #4
    Join Date
    Jul 2002
    Posts
    2,543

    Re: Draw and safe an image

    Drawing should be always done in a main thread.
    Histogram calculation may be done in a worker thread, if it takes significant time. You need realy large image to get long histogram calculation time. I don't think this is right place for multithreading.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured