Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. creating directx texture from raw image data

creating directx texture from raw image data

Scheduled Pinned Locked Moved C / C++ / MFC
helpgraphicsgame-devdata-structuresquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andreoli Carlo
    wrote on last edited by
    #1

    My goal: - display a texture that i can modify in real time (windowing the histogram) My steps: 1) create an array that will hold my raw information with fast access so i can modify windowing, the array is declared by setting RGB values 8 bit per pixel // declaring array that will hold raw image array<Byte> dataArray = gcnew array<Byte>(Length); 2) modify the values of the images and set it to texture IO::MemoryStream ^fs = gcnew IO::MemoryStream(this->dataArray); fs->Seek(0,IO::SeekOrigin::Begin); try { mTexture = TextureLoader::FromStream(this->device, fs, (int)fs->Length, 768, 640, 0, Usage::None, Format::R8G8B8, Pool::Default, Filter::None, Filter::None, 0); } catch (Direct3D::InvalidDataException ^e) { te=e->ToString(); } fs->Close(); 3) display a sprite with texture in it mSprite->Begin(SpriteFlags::None); mSprite->Draw(this->mTexture, Rectangle(posx*3,posy*3, 5000,5000), Vector3(0.0F, 0.0F, 0.0F), Vector3(0.0F, 0.0F, 0.0F), Color::White); mSprite->End(); the problem is that in this step it die on execution :( An unhandled exception of type 'Microsoft.DirectX.Direct3D.Direct3DXException' occurred in Microsoft.DirectX.Direct3DX.dll Additional information: Error in the application. Someone can help me point out the problem? thank in advance

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups