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 8074983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:50:32+00:00 2026-06-05T14:50:32+00:00

I’m trying to send a BitmapSource from my WCF service to my client app.

  • 0

I’m trying to send a BitmapSource from my WCF service to my client app. Both are .NET 3.5 applications. I’m seemingly able to serialze the object without an issue (no exceptions occur), but my callback on my client never gets called. After adding a trace to log exceptions on my client, I see that the DataContractSerializer can’t deserialize the BitmapSource.

The error is: ‘Element ‘http://schemas.datacontract.org/2004/07/Test.VisionStudio.Remote:Image’ contains data of the ‘http://schemas.datacontract.org/2004/07/System.Windows.Interop:InteropBitmap’ data contract. The deserializer has no knowledge of any type that maps to this contract. Add the type corresponding to ‘InteropBitmap’ to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.’.

So, I did what it said and added the known types to the service contract and callback contract, but I’m still getting the same errors.

Here’s the service callback contract and data contract I’m sending (remove irrelevant DataMembers):

[ServiceKnownType(typeof(BitmapSource))]
[ServiceKnownType(typeof(InteropBitmap))]
public interface IZynVisionStudioRemoteServiceCallback
{
    [OperationContract(IsOneWay=true)]
    void OnVisionResultsReady(RemoteVisionProductResult result);

    [OperationContract(IsOneWay = true)]
    void ServiceShuttingDown();
}


[DataContract]
public class RemoteVisionProductResult
{
    private bool _status;
    /// <summary>
    /// Status of the overall inspection. Pass = True, Fail = False
    /// </summary>
    [DataMember]
    public bool Status
    {
        get { return _status; }
        set { _status = value; }
    }

    private string _product;
    /// <summary>
    /// Name of the product the results came from
    /// </summary>
    [DataMember]
    public string Product
    {
        get { return _product; }
        set { _product = value; }
    }

    private string _inspection;
    /// <summary>
    /// Name of the inspection the results came from
    /// </summary>
    [DataMember]
    public string Inspection
    {
        get { return _inspection; }
        set { _inspection = value; }
    }

    private List<RemoteVisionImage> _images = new List<RemoteVisionImage>();
    [DataMember]
    public List<RemoteVisionImage> Images
    {
        get { return _images; }
        set { _images = value; }
    }

    private List<RemoteVisionImage> _imagesWithGraphics = new List<RemoteVisionImage>();
    [DataMember]
    public List<RemoteVisionImage> ImagesWithGraphics
    {
        get { return _imagesWithGraphics; }
        set { _imagesWithGraphics = value; }
    }
}


[DataContract]
public class RemoteVisionImage
{
    /// <summary>
    /// Image uploaded from the vision system
    /// </summary>        
    [DataMember]
    public BitmapSource Image { get; set; }

    /// <summary>
    /// Name of the camera the image was uploaded from
    /// </summary>
    [DataMember]
    public string Camera { get; set; }

    public RemoteVisionImage()
    {
    }
}

Can anyone help me figure out why I can’t send this image across the wire?

EDIT: I should add, my client updates the service reference as expected, and shares assemblies with the service, so the implementation of RemoteVisionProductResult and RemoteVisionImage is also on the client.

  • 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-06-05T14:50:33+00:00Added an answer on June 5, 2026 at 2:50 pm

    This was resolved by adding a Bitmap property to the DataContract, converting from BitmapSource to Bitmap on the service side, sending it across the wire, and re-building the BitmapSource on the client side using the palette and other properties from the Bitmap.

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am writing an app with both english and french support. The app requests
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.