converting from vb to c# RRS feed

  • Question

  • User898048251 posted

    I have a piece of code in VB that I want to use to resize images.  I think I have successfully converted most of it to C#, but I am not sure about this bit :

    Function ThumbnailCallback() as Boolean
        Return False
      End Function

    Here is the bit of the code that is calling it :

    Response.ContentType = "image/gif"
        If imageHeight > 0 and imageWidth > 0 then
          Dim dummyCallBack as System.Drawing.Image.GetThumbNailImageAbort
          dummyCallBack = New _
             System.Drawing.Image.GetThumbnailImageAbort(AddressOf ThumbnailCallback)

          Dim thumbNailImg as System.Drawing.Image
          thumbNailImg = fullSizeImg.GetThumbnailImage(imageWidth, imageHeight, _
                                                       dummyCallBack, IntPtr.Zero)

          thumbNailImg.Save(Response.OutputStream, ImageFormat.Gif) 

    Can anybody help?

    Friday, September 4, 2009 5:06 AM


  • User898048251 posted

     Found the answer to this...I had another part of the code converted
    wrong and that was what was causing problems with the part that I
    couldn't get to work.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 4, 2009 7:06 AM