Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7176501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:31:15+00:00 2026-05-28T16:31:15+00:00

I am using the following code to bind an image from my database (compact

  • 0

I am using the following code to bind an image from my database (compact sql) to my image control:

<Image MaxHeight="100" Stretch="UniformToFill">
    <Image.Source>
        <BitmapImage DecodePixelHeight="200" 
             StreamSource="{Binding ImageData}" />
    </Image.Source>
</Image>

The reason for using BitmapImage is because I found that when I used image, the thumbnails presented were so large that it slowed the program down. I intend on using the DecodePixelHeight property within bitmapimage to allow me to use a smaller thumbnail size and hence keep my program from slowing down.

The issue I get when binding this to my image is an error saying I have not set StreamSource correctly. I have a feeling this is because my image is stored as bytes in the database (converted before hand) and that BitmapImage (unlike the standard Image) does not support automatic converting into an image format.
Is this correct? If so, do I simply need to implement a converter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:31:16+00:00Added an answer on May 28, 2026 at 4:31 pm

    The issue you face is most probably related to a fact that your ImageData is not type of Stream, which is actually required by the StremSource property.

    The hypothetical code, could be something like this:

    Byte[] imagesBytes = GetBytesOfImageFromDB();
    ImageData= new MemoryStream(imagesBytes); 
    

    Assuming that in this case ImageData model viewer property is of type Stream.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following lines of code which is using JQTOUCH: $('#customers').bind('pageAnimationEnd', function(e, info){ if
I'm using following code but cannot return data from MySQL. This is the output:
Using the following code, I'm retrieving a list of Integers from a DB and
I use the following code to reload an image using jQuery: //Fetch image associated
I'm using the following code to bind the users to the model [to be
The following code produces the image that follows. The image I am using for
I am using the following code to sync 2 input boxes. $(#input_box_1).bind(keyup paste, function()
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I am using following code to check whether a check box on my website
I am using following code to design my home page. The output (as shown

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.