Re: Best way to create graphical window inside a dialog?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you are doing any kind of animation then painting off of WM_PAINT is
potentially problematic. WM_PAINT messages are low priority all things
considered, so there is potentially a lot of latency between doing an
InvalidateRect and actually getting your paint message.

Also, because you are painting what you describe as a tilemap, you dont want
to paint directly to the dialogs DC anyway. PAinting to a screen DC reflects
the changes instantly, so you you have any overlapping at all, the users
will see the scene get progressivly built up.

You need to create an offscreen bitmap, do your painting to that, and paint
that whenever it changes.

With an offscreen bitmap in hand, you can then paint to that in response to
a timer / whenever your tilemap changes, and blit that to the screen, or,
when and if WM_PAINT messages do come through - due to user interactions -
you can paint it again there too.

The painting problems you had when resizing is this: Windows dialog controls
do not support being overlapped. They will end up drawing over each other
and as a result not painting properly as the overlapped painting isn't
detected as a reason to invalidate and repaint.

your most recent painting problems are the sort of thing I experience when I
accidentally treat my DialogProc as a WindowProc. DialogProc *must* return
FALSE for all messages that you dont handle yourself. You MUST NOT call
DefWindowProc (or any kind of API Def* proc) from a DialogProc. That is done
automatically by you returning FALSE.

"DrDerekDoctors" <graham@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1156499034.034564.172560@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Mihai N. wrote:
As for the picture control thing, though, I'll give that a whizz but I
suspect I'll still have problems with my inability to get my dialog to
repaint itself at my command.
You don't need to get the dialog to repain itself.
In fact, you should never care about that.
You should care about the controls repainting, yes.

Are you trying a plain vanila Win32, or MFC?

Plain vanilla Win32. Sorry, what I meant was getting the controls to
repaint, but even so - they don't seem to want to. Unless I can do it
outside of the WM_PAINT message but I read that you really shouldn't do
that.

Graham



.



Relevant Pages

  • John Hwangs Painting Notes, 2006
    ... By no means should this be considered the final word in painting miniatures. ... Dark vs Bright strongly affects your overall visual style. ... If you're going to paint, you'll need the appropriate supplies: quality brushes, acrylic paint, spray primer, epoxy putty or SGT, glue, pins, hobby knife, and "needle" files. ... As you'll be using the same set of brushes for *all* of your minis, this is *not* the place to try and "save" money; if anything, double up on the brush sizes you use most often so that they last just that much longer. ...
    (rec.games.miniatures.warhammer)
  • Re: Weird Problem in using MouseListener
    ... Repaint does not call paint. ... which is also used for painting. ...
    (comp.lang.java.programmer)
  • Re: [Paint][Model] Painting/assembling plastics
    ... I have a beginner's question about painting multi-part plastic models. ... If I do a squad of guardians, is it a good idea to paint the ... Plastics if you haven't worked with them much are a bit different ... Can quickly field large numbers of minis with a 'basic' paint ...
    (rec.games.miniatures.warhammer)
  • Vandal Hussains Art Exhibit Vandalized!
    ... If spraying of paint can ... be called art for Hussain, why not spraying of black paint? ... Hindu activists with financial and other links to political extremists ... and sprayed the painting called Durga with black paint. ...
    (soc.culture.indian)
  • Re: Painting over a painting?
    ... layer of paint on it. ... If it's not crucial to Gesso it, ... is a small pool of oil at the top. ... See that is the tricky bit about painting over someone else's work, ...
    (rec.arts.fine)