- Large Images NOT Showing?

OK, so I have this code to convert TIFF Images to PNG, but when I go to display VERY Large (FULL Page) Documents they DO NOT display???

        Dim path As String = Server.MapPath("~/Images/" & TextBox1.Text & ".tif")
        Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(path)

        Using memoryStream As New MemoryStream()
            image.Save(memoryStream, ImageFormat.Png)
            Dim bytes As [Byte]() = New [Byte](memoryStream.Length - 1) {}
            memoryStream.Position = 0
            memoryStream.Read(bytes, 0, CInt(bytes.Length))
            Dim base64String As String = Convert.ToBase64String(bytes, 0, bytes.Length)
            DocumentImage.Src = "data:image/png;base64," & base64String
        End Using

Is there some kind of PNG Limit or String Limit on the "base64String"?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kamal KhaleefaInformation Security SpecialistCommented:
try to increase the maxRequestLength in web.config to higher value to be able to execute your command

for example

      <httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="15360" requestLengthDiskThreshold="15360" executionTimeout="400"/>

this directive is inside <system.web>
smithmrkAuthor Commented:
OK, I added that line, but it still doesn't display my image.
I get a Red X

Kamal KhaleefaInformation Security SpecialistCommented:

check this link

also try this

    Bitmap.FromFile("your image.tif")
              .Save("your image.png", System.Drawing.Imaging.ImageFormat.Png);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smithmrkAuthor Commented:
OK, Yes I can convert it and save it...but I don't want to have to clean up those files once done.
I was hoping I could take the TIF Image and convert it in memory use it then just clear the memory rather than have to clean up PNG Files on the server.

smithmrkAuthor Commented:
OK, I gave up...I'm going to save the image display it and when I'm done remove it.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.