Thread: VC++ OnPaint() problem

  1. #1
    Registered User
    Join Date
    Jan 2008

    VC++ OnPaint() problem


    This may not be the best place for this type of discussion but still if anybody knows then help me!
    I am just trying to make a basic Paint like application. The problem is that when i draw rectangle selecting the rect tool from the toolbar it draws perfectly, but as i minimised and then maximise or just resize it the content of the window disappears! as the WM_PAINT message is received.

    I tried to use one approach i.e consider the whole client area as a bitmap but i need some standard approach to this approach. Please help me
    Thanks in advance!

    Best Regards,

  2. #2
    Registered User
    Join Date
    Dec 2007
    Make your drawing to a memory dc and in the paint function, bitblt it to the paint dc. I've done this by making the memory dc a member variable of the window class, so it is persistant. This is basically storing the client area to a bitmap, as you suggested.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Classic Linking SDL in VC Problem
    By IdioticCreation in forum C++ Programming
    Replies: 1
    Last Post: 12-26-2007, 08:39 AM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM