Results 1 to 2 of 2

Thread: [2005] GDI+ Bitmap Constructor

  1. #1

    Thread Starter
    Frenzied Member conipto's Avatar
    Join Date
    Jun 2005
    Location
    Chicago
    Posts
    1,175

    [2005] GDI+ Bitmap Constructor

    Hi there,

    I'm using this constructor of the bitmap class:

    http://msdn2.microsoft.com/en-us/lib...5z(VS.80).aspx

    VB Code:
    1. 'for example
    2.  
    3. MyImage = new Bitmap(MyImage, new Point(this.Width, this.Height));
    Which takes as one argument an existing bitmap, and as a second argument, the new size. The idea was to expand the accesible area of an existing bitmap, but to my dismay, this causes the image to stretch - not simply increase the overall dimensions. Does anyone know of an easy way to do this that does not involve creating a new bitmap image, and a graphics object, then drawing my current one on there? This will be for a resize event, so as you can imagine, that would be pretty flicker-ific if I had to create and destroy images that often.

    Bill
    Hate Adobe Acrobat? My Codebank Sumbissions - Easy CodeDom Expression evaluator: (VB / C# ) -- C# Scrolling Text Display

    I Like to code when drunk. Don't say you weren't warned.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [2005] GDI+ Bitmap Constructor

    It only flickers if you use the screen as a storage medium which is always a bad idea. Your idea about drawing the image onto the larger area is correct though. Just do it to a backbuffer first and then draw it to the screen in a custom paint event.

    Flicker can be eliminated by using SetStyles() on the screen object you are drawing to.
    I don't live here any more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width