Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 634283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:16:38+00:00 2026-05-13T20:16:38+00:00

I am painting an jpeg image using IPicture. At first I load it, then

  • 0

I am painting an jpeg image using IPicture.
At first I load it, then if some conditions are met I draw it in the WM_Paint using IPicture::Render function. The problem is that it doesn’t draw image if the window is closed by another window, and when I remove the closing window, only that image shows where the window was closing it. I used double buffering but the same problem, and
I know that I should use InvalidateRect, But I can’t Understand where to use it? Is there a special event like – you have to update your window?
I need some place where I can use the InvalidateRect function.
Can you help me?
Now I tryed using it in the CALLBACK WndProc in the default case of the switch.
I just checked it (using double buffering) and the image is drawn imediatly even if there is an other window partially closing it, but I got flickering every time if I resize, move the window or move another window.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:16:39+00:00Added an answer on May 13, 2026 at 8:16 pm

    The question doesn’t really explain the situation very well. However:

    Q: At first I load it, then if some conditions are met I draw it in the WM_PAINT using IPicture::Render function.

    A: Always paint the picture in WM_PAINT. WM_PAINT is sent whenever the windows contents are damaged (by the window being resized, or uncovered by other windows) so you MUST paint during WM_PAINT or you will get unnpainted areas.

    Q: I know that I should use InvalidateRect, But I can’t Understand where to use it? Is there a special event like

    A: Windows automatically calls InvalidateRect whenever Windows damages your windows contents (like when you uncover your window, restore your window, or resize your window). This ensures that a WM_PAINT message will be sent to your window.
    You need to call InvalidateRect() whenever you change the contents of your window – for example when you finish loading a new image you would call InvalidateRect to get windows to send you a `WM_PAINT and the new image would be painted then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a painting app. In that, I draw some image. But I
I'm programatically printing a JPEG image, which I load with GDI+, to a virtual
I considered using Apple's GLPaint example (http://developer.apple.com/library/ios/#samplecode/GLPaint) to do some finger painting. However, I
I'm painting this object in C# using GDI and I need to have precise
I have a userControl I'm doing some Painting to, and when the control is
I have one app, a UIImage* . I'm painting the image twice: Once in
I have this code for watermarking text onto an image if($type==.jpg or $type==.jpeg){ $im
When performing some custom painting on a button's Graphics2D object, I get the following
M using the following code for printing but if there are some long lines
I am trying to perform a realtime painting to the object texture. Using Irrlicht

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.