resize am imagen from database before show in the control imagen

Posted on 2011-10-16
Last Modified: 2012-05-12
Hello all,
I've a process to fetch images from database to the image control the code is a .ashx file and this is.

  Dim o As Object = command.ExecuteScalar
        If o Is Nothing Or IsDBNull(o) Then
            Dim d As Byte() = CType(command.ExecuteScalar(), Byte())
            output.Write(d, 0, d.Length)
        End If

Well it's working but now I have to control the image's size, I was thinking to do in this code, but my first problem is...

How Can I transform the d "BYTE()" into an object image to perform all the changes easily.

any idea?

Question by:limmontreefree
    LVL 51

    Expert Comment

    first of all you execute it twice, change this line

         Dim d As Byte() = CType(command.ExecuteScalar(), Byte())
         Dim d As Byte() = CType(o, Byte())
    LVL 51

    Accepted Solution

    to convert a byte array to image you can use the code here

    Author Closing Comment

    fully successful


    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now