Announcement

Collapse
No announcement yet.

Freeze hDC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Freeze hDC

    Inside WM_PAINT I try to execute two covering each other TextOut
    (big font).
    I use different colors and it's visible blinking during a short time.
    Is it possible to "freeze" hDC from GetDC up to ReleaseDC ?

  • #2
    I gather you want to eliminate the "flicker"?

    The best way if to use a "hidden DC" and then just BltBit() it to the window during %WM_PAINT.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Lance --
      I understood idea. Thanks.

      One probem. It looks that in any case I should
      CreateCompatibleBitMap and select it into CreateCompatibleDC
      Is it so ?

      [This message has been edited by Semen Matusovski (edited April 07, 2000).]

      Comment


      • #4
        semen, this will answer your questions.

        creating a virtual window for supercharged repaints.

        [url]http://l]

        hth
        jules
        Best regards
        Jules
        www.rpmarchildon.com

        Comment


        • #5
          Jules --
          I see in this sample
          Code:
          memdc = CreateCompatibleDC(hdc)
          hbit = CreateCompatibleBitmap(hdc, maxX, maxY)
          SelectObject memdc, hbit
          This way I know and it's works.
          I am surprised that it's necessary to create dummy bitmap, because in my code I execute BitBlt hdc -> hdcMem in any case.


          ------------------

          Comment


          • #6
            Unless you create a bitmap and select it into the DC, the DC has no size... the bitmap specifies the 'boundary' (for lack of a better word) of the DC.

            From WIN32.HLP:
            CreateCompatibleDC:
            Before an application can use a memory device context for drawing operations, it must select a bitmap of the correct width and height into the device context. Once a bitmap has been selected, the device context can be used to prepare images that will be copied to the screen or printed.

            ------------------
            Lance
            PowerBASIC Support
            mailto:[email protected][email protected]</A>
            Lance
            mailto:[email protected]

            Comment

            Working...
            X