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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:26:48+00:00 2026-05-25T12:26:48+00:00

How do I access the data in a Texture2D object? Lots of XNA posts

  • 0

How do I access the data in a Texture2D object? Lots of XNA posts suggest using the function Texture2D.GetData but that appears to be missing in the SlimDX version of a Texture2D. I need to process my image to calculate overall luminance of the scene and don’t want to be running 300 accesses in a pixel shader (i.e. 300 access * num_pixels per frame) when I could be doing it once per frame.

All I need to be able to do is access the colour (R32G32B32A32) of the texture.

Ah I reckon I’ve found it thanks to the SlimDX SDK. The Texture2D.ToStream() method sends the texture data to a memory stream, then I simply have to parse the bytes to get at my data. I’ll submit this as an answer if it works for me.

  • 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-25T12:26:49+00:00Added an answer on May 25, 2026 at 12:26 pm

    Yep, ToStream() works fine, thanks to the SlimDX SDK. The Texture2D.ToStream() method sends the texture data to a memory stream, then I simply have to parse the bytes to get at my data.

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

Sidebar

Related Questions

When using a DataReader object to access data from a database (such as SQL
I'm trying to access data within a JSON object I create using json_decode (based
I am trying to access data from list view using columnheader name but I
Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But
I have a Access Data Project that connects to an SQL server database. Recently
I am using Access 2003 to access data stored in a SQL Server database
Suppose I have an application that access data resident in a central DB server
I want to convert the ms access data into a document so that the
We have the Trie structure to efficiently access data when the key to that
I'm trying to access data from two different databases inside a transactionscope. But while

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.