CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #5
    Join Date
    Feb 2000
    Location
    OH - USA
    Posts
    1,892

    Arrow Re: Stretchblt in .NET

    Or you can just use the Graphics.DrawImage method. It will stretch the image for you.

    Code:
            Dim destinationImage As New Bitmap(100, 100)
            Dim sourceImage As Image = PictureBox1.Image
            Dim g As Graphics
    
            g = Graphics.FromImage(destinationImage)
    
            g.DrawImage(sourceImage, New Rectangle(0, 0, destinationImage.Width, destinationImage.Height), 0, 0, sourceImage.Width, sourceImage.Height, GraphicsUnit.Pixel)
    
            g.Dispose()
    
            PictureBox2.Image = destinationImage
    Last edited by Craig Gemmill; September 30th, 2010 at 08:52 AM.
    Good Luck,
    Craig - CRG IT Solutions - Microsoft Gold Partner

    -My posts after 08/2015 = .NET 4.x and Visual Studio 2015
    -My posts after 11/2011 = .NET 4.x and Visual Studio 2012
    -My posts after 02/2010 = .NET 4.0 and Visual Studio 2010
    -My posts after 12/2007 = .NET 3.5 and Visual Studio 2008
    -My posts after 04/2007 = .NET 3.0 and Visual Studio 2005
    -My posts before 04/2007 = .NET 1.1/2.0

    *I do not follow all threads, so if you have a secondary question, message me.

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

Featured