Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The form refresh so slow

The form refresh so slow

Scheduled Pinned Locked Moved C#
tutorialquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fired Fish Gmail
    wrote on last edited by
    #1

    I use one image as the background picture. But when open the form, it shows so slow. How to solve it ?

    D 1 Reply Last reply
    0
    • F Fired Fish Gmail

      I use one image as the background picture. But when open the form, it shows so slow. How to solve it ?

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      What are the things you are doing when the form is loading? Is it possible to move some of that to another thread? You can also use a splash screen and display the form only when all the operations are done.

      F 1 Reply Last reply
      0
      • D dan sh

        What are the things you are doing when the form is loading? Is it possible to move some of that to another thread? You can also use a splash screen and display the form only when all the operations are done.

        F Offline
        F Offline
        Fired Fish Gmail
        wrote on last edited by
        #3

        Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.

        T D 2 Replies Last reply
        0
        • F Fired Fish Gmail

          Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.

          T Offline
          T Offline
          The Man from U N C L E
          wrote on last edited by
          #4

          I wonder if you are shrinking the image to fit, or should I say, .Net is shrinking it to fit. Check the actual size of the image and resize it to no larger than your form. You could also try some of the tricks from the html world, for example if you are aiming for a gradient fill, use a 1 pixel wide image and stretch it.

          If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

          F 1 Reply Last reply
          0
          • F Fired Fish Gmail

            Only initialize 20 controls, in which a circle is drawed. I try to delete background image, the form shows more quickly. So , it must the background image's problem. I am trying your solution, thanks very much.

            D Offline
            D Offline
            dan sh
            wrote on last edited by
            #5

            20 controls should not slow things drastically down. As the other reply mentions, check the image size and resize it to your needs. The type of file also matters. A bitmap file will be of a way more size (Bytes) than a same sized (dimension) JPG or JPEG.

            F 1 Reply Last reply
            0
            • T The Man from U N C L E

              I wonder if you are shrinking the image to fit, or should I say, .Net is shrinking it to fit. Check the actual size of the image and resize it to no larger than your form. You could also try some of the tricks from the html world, for example if you are aiming for a gradient fill, use a 1 pixel wide image and stretch it.

              If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles]  [My Website]

              F Offline
              F Offline
              Fired Fish Gmail
              wrote on last edited by
              #6

              Thanks for your reply. I donot shrink this image. but I only set the image as the background image of the form, perhaps this form's size is not equals to this image's size, when OnPaint it need use much time to let the image size to fix the form's size? I put many control in the forms, such as panle. I set these control's backcolor as transparent. Does the backcolor's transparent cost much time?

              1 Reply Last reply
              0
              • D dan sh

                20 controls should not slow things drastically down. As the other reply mentions, check the image size and resize it to your needs. The type of file also matters. A bitmap file will be of a way more size (Bytes) than a same sized (dimension) JPG or JPEG.

                F Offline
                F Offline
                Fired Fish Gmail
                wrote on last edited by
                #7

                The image is about 30kB in JPEG format, I will try to minish its size.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups