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

  • Home
  • SEARCH
  • 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 8691663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:09:57+00:00 2026-06-13T00:09:57+00:00

Problem with my approach is that image, text or line drawn, lags by maybe

  • 0

Problem with my approach is that image, text or line drawn, lags by maybe 0.2 seconds, when resizing the form. So if you need an image in bottom right corner, it takes that 0.2 seconds to come in place after resize. Also, if you do heavy resizing, it starts lagging down to 1-2FPS, while the form expands on a big screen. Sample code looks like this (VB.NET):

Public Class Form1
  Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
    MyBase.OnPaint(e)
    Dim icon As Icon = SystemIcons.Exclamation
    Dim imageWidth As Integer = icon.Width
    Dim imageHeight As Integer = icon.Height
    e.Graphics.DrawIcon(icon, Me.ClientRectangle.Right - imageWidth,
                              Me.ClientRectangle.Bottom - imageHeight)
  End Sub
  Private Sub Form1_Resize(sender As Object, e As System.EventArgs) Handles Me.Resize
    Me.Invalidate()
  End Sub
End Class

Is there anything that can be done to make it smoother?

  • 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-06-13T00:09:58+00:00Added an answer on June 13, 2026 at 12:09 am

    Resizing your window is always going to involve redrawing the image in the new location. However, there are some things you can try that may or may not make the redrawing more efficient.

    1. Only invalidate the old and new position of the image, not the whole form. This means that you don’t have to paint parts of the window that don’t change.
    2. Copy the image from the old location to the new location. You have to be careful here to invalidate the right parts of the window, particularly when the window is getting smaller and the old and new image areas overlap.
    3. Create a separate control for the image, and move the control to the correct location. The form and the control will then automatically invalidate the correct regions.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The very act of asking this question suggests that my approach to this problem
What approach can I take to solve my problem such that my Android app
I need to show an image that is 4000x6000 px. What are your experiences
I have a table of canvas elements that emulates tiled image. I need to
I was wondering how people would approach the problem of merging two 3D objects?
I'm thinking about how to approach the problem at hand. There's a flash movie
I'm using a naive approach to this problem, I'm putting the words in a
I'm after some guidance on how to approach coding a problem, I don't want
just had a general question about how to approach a certain problem I'm facing.
I have tried this approach/hack: http://blog.blackwhale.at/2009/06/uibuttons-in-uinavigationbar/ The problem is this leaves a faint seam.

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.