C# / *.NET: Resize Bitmap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShadowLocke
    New Member
    • Jan 2008
    • 116

    C# / *.NET: Resize Bitmap

    I have a small program that resizes a bitmap according to mouse location. (see me talking to myself in this forum: http://bytes.com/forum/thread795956.ht ml)

    So every time the mouse moves it resizes the bitmap.

    Any ideas on what would be the fastest way to resize a bitmap? (Im not looking for quality, just speed)
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    The Image(or is just Bitmap) object has a like MakeThumbnail function that just takes in a new size and returns a resized version of the image.

    Comment

    • ShadowLocke
      New Member
      • Jan 2008
      • 116

      #3
      Are you refering to "Image.GetThumb nailImage"?

      I have just tried this, it did not appear to speed things up. Although, Im starting to think the resize may not be whats causing my slow down.

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        What if, you take a Picturebox control and set the background image property to your image. Then set the (can't think of it's name) property to "Stretch" (as opposed to "center" or etc)
        Then change the actual size of the picturebox control with the mouse, maybe that will work faster?

        Comment

        • ShadowLocke
          New Member
          • Jan 2008
          • 116

          #5
          Actually I narrowed down my problem to "Graphics.DrawI con()" I was thinking the resize was taking up the time, but after changing it up and using "Graphics.DrawI mage()" instead it drew a great deal faster.

          This came with flicker...doubl e buffer ftw.

          Comment

          Working...