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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:54:53+00:00 2026-05-16T06:54:53+00:00

Attempting to do SetData() on Texture2D that has been recently Draw()-n by SpriteBatch leads

  • 0

Attempting to do SetData() on Texture2D that has been recently Draw()-n by SpriteBatch leads to following exception:

The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket.

Can I determine in advance if executing SetData() will throw this exception?

  • 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-16T06:54:54+00:00Added an answer on May 16, 2026 at 6:54 am

    Basically, you have three options:

    1) See if SpriteBatch has finished it’s operation and call SetData() afterwards. The drawing methods usually are asynchronous. That means that, they just get added to the please-render-me queue and the method returns immediately. What you need is either a callback notification when the drawing has finished or a synchronous call to Draw().

    2) Avoiding that SetData() gets interrupted. You can do that by putting it into a critical section which I would not recommend. It should be possible to lock the texture data. It’s called LockRect() in Direct3D, it should be similar in XNA.

    3) There should be some method like Flush() somewhere that waits until all graphics-related operation have finished.

    Sorry for the rather vague help, but you should be able to find the method names from the XNA doc.

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

Sidebar

Ask A Question

Stats

  • Questions 532k
  • Answers 532k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer html code <a id="a_lnk" href="http:\\www.cnn.com">cnn</a>​ javascript code // find a… May 17, 2026 at 12:04 am
  • Editorial Team
    Editorial Team added an answer It seems I am suffering from a bug [1] in… May 17, 2026 at 12:04 am
  • Editorial Team
    Editorial Team added an answer I eventually got it with Split(), The problem might have… May 17, 2026 at 12:04 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

EDIT -- Answered below, missed the angled braces. Thanks all. I have been attempting
if the parent's datasource has a child property that is a collection (let's say
I'm attempting to force a download of an image that is in a directory
I'm attempting to write a performance testing function that can take any function, run
I'm attempting to use Windsor and NHibernate in a medium trust environment and I'm
I am attempting to create a mosaic of images in Java. I calculate the
I have a constructor attempting to initialize a field in a base class. The
I am attempting to pass back a Node type from this function, but I
I am attempting to set a cookie on a particular page to be read
I have an app that allows you to take a picture, adjust the jpeg

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.