Thread: Drawing with buttons

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User Dohojar's Avatar
    Join Date
    Feb 2002
    Posts
    115
    Just remember to release it once you are done with it by calling ReleaseDC(). So in your case:
    Code:
    case WM_COMMAND:
    {
        switch(LOWORD(wParam))
        {
            case IDC_BUTTON_IMAGE1:
            {
                hdc = GetDC(/*Handle to window in here*/) ; 
                 for(j=0;j<256;j++)
                {
                    for(k=0;k<256;k++)
                    {
                        SetPixel(hdc,256+j,256+k,RGB(0,j,k));
                    }
                }        
                Arc(hdc,200,200,300,300,100,100,200,200);
                ReleaseDC(/*Handle to window in here*/,hdc);
                break;
            }
        }
        break;
    Last edited by Dohojar; 09-12-2003 at 02:33 PM.
    Dohojar Moajbuj
    Time is the greatest teacher, too bad it kills all its students

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 04-09-2009, 02:31 AM
  2. Slow drawing code
    By tjpanda in forum Windows Programming
    Replies: 5
    Last Post: 05-09-2008, 05:09 PM
  3. Ownerdraw buttons (2)
    By maes in forum Windows Programming
    Replies: 7
    Last Post: 09-11-2003, 05:50 AM
  4. couple of questions on drawing text and buttons
    By Leeman_s in forum Windows Programming
    Replies: 3
    Last Post: 12-28-2002, 11:45 AM
  5. Grouping radio buttons
    By Bazz in forum Windows Programming
    Replies: 1
    Last Post: 08-28-2001, 07:15 AM