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

  • Home
  • SEARCH
  • 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 5840533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:45:38+00:00 2026-05-22T11:45:38+00:00

In Silverlight, the VideoSink.OnSample method is used to get raw webcam data. The function

  • 0

In Silverlight, the VideoSink.OnSample method is used to get raw webcam data. The function signature is as follows:

protected abstract void OnSample(
    long sampleTimeInHundredNanoseconds,
    long frameDurationInHundredNanoseconds,
    byte[] sampleData
)

Documentation for sampleData says

A byte stream that contains video data. The byte stream should be processed into samples according to the relevant video format information.

Going to the documentation of the VideoFormat class, one gets to the VideoFormat.PixelFormat property which can only have two possible values according to the documentation:

  • Unknown – The format is unknown.
  • Format32bppArgb – The format uses 32 bits of color information per pixel and reports color information by using alpha, red, blue, and green channels.

I want to understand how the sampleData parameter for the VideoSink.OnSample method looks like. Is it simply an array of pixels like the following?

sampleData[0] = image[x = 0, y = 0].R;
sampleData[1] = image[x = 0, y = 0].G;
sampleData[2] = image[x = 0, y = 0].B;
sampleData[3] = image[x = 0, y = 0].A;
sampleData[4 to 7] = image[x = 0, y = 1];
sampleData[8 to 11] = image[x = 0, y = 2];
sampleData[4*Height-4 to 4*Height-1] = image[x = 0, y = Height];
sampleData[4*Height to 4*Height+3] = image[x = 1, y = 0];
// ...

If it is that easy: Is the ordering correct?

  • R before G before B before A for each pixel
  • All pixels of first column before all pixels of second column and so on
  • 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-22T11:45:38+00:00Added an answer on May 22, 2026 at 11:45 am

    The byte stream looks as follows for the Format32bppArgb pixel format:

    sampleData[0- 3] = image[x=0, y=0]
    sampleData[4- 7] = image[x=1, y=0]
    sampleData[8-11] = image[x=2, y=0]
          ...                ...
                       image[x=w, y=0]
                       image[x=0, y=1]
                             ...
                       image[x=w, y=h]
    

    So, it is stored row by row.

    For each pixel which is stored in bytes i to i+3 the information comes as follows:

    sampleData[i+0] = BLUE
    sampleData[i+1] = GREEN
    sampleData[i+2] = RED
    sampleData[i+3] = ALPHA
    

    All channels are stored as an integer in the range [0; 255] where 255 indicates the maximum intensity for the color channels and opaque for the alpha channel. So, besides the ordering it works like expected.

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

Sidebar

Related Questions

Silverlight works on client side so putting any sensitive data like connection strings, passwords
Could Silverlight be used for the same things as jQuery, or are they intended
Silverlight v2.0 is getting closer and closer to RTM but I have yet to
Silverlight has been available since quite some time, and Silverlight 2 allows .Net programming
In Silverlight how can I launch / navigate to another page?
Does silverlight support the remoting functionality of the .net framework?
In Silverlight, I have a Vertical ListBox that has a Horizontal ListBox for each
Since silverlight does not have any support for DataSets/DataTables, what would be the best
In Silverlight, when you want to create a control dynamically, you must add the
In Silverlight (and I guess WPF) why are the properties x:name x:fieldmodifier x:uid the

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.