Resize Photo and Save to DB

Thread is closed for posting
2 posts, 1 answers
  1. Sam
    Sam avatar
    59 posts
    Member since:
    Apr 2008

    Posted 04 Sep 2009 Link to this post

    I'm working on a project where i need to upload images to a DB. The images could vary in size when being uploaded by the clients, but when inserted in the DB, they cannot be larger than 640x480. I went through the examples in the documentations, they all reference saving the images to the file system. I'm having a hard time doing the conversion to a bitmap, then to a GraphicImage, then back to a byte stream to insert in the DB. Loading the original UploadedFile into the DB is not an issue at all:

    Dim FileBytes(PhotoFile.InputStream.Length - 1) As Byte

     

     

     

    PhotoFile.InputStream.Read(FileBytes, 0, PhotoFile.InputStream.Length)

    Any help would be appreciated,
    -Sam

     

  2. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 07 Sep 2009 Link to this post

    Hello Sam,

    I have attached a sample project that shows how to resize images and save them to a database. I hope it will help you to get started.

    Regards,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top