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#
  4. Managed DirectX: load large Bitmap

Managed DirectX: load large Bitmap

Scheduled Pinned Locked Moved C#
graphicsquestionwinformsgame-devperformance
7 Posts 2 Posters 1 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.
  • S Offline
    S Offline
    silka_c
    wrote on last edited by
    #1

    ANYONE GOOD IDEAS? I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps. But I need to display large Bitmaps (e.g. 5000x4000 Pixels), which cannot be directy loaded in ONE Texture. My graphics card supports textures up to 4096X4096 Pixels, which is even not enough :sigh: And most of the common graphics cards don't support textures this size, right? How can I split one Bitmap in different Textures so that I can display these Bitmaps? That was my idea, but I don't know how to do it. :(( Or does anyone have another idea of displaying Bitmaps this size? :confused: I would be very greatful if anyone can help me! :) Silka

    D 1 Reply Last reply
    0
    • S silka_c

      ANYONE GOOD IDEAS? I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps. But I need to display large Bitmaps (e.g. 5000x4000 Pixels), which cannot be directy loaded in ONE Texture. My graphics card supports textures up to 4096X4096 Pixels, which is even not enough :sigh: And most of the common graphics cards don't support textures this size, right? How can I split one Bitmap in different Textures so that I can display these Bitmaps? That was my idea, but I don't know how to do it. :(( Or does anyone have another idea of displaying Bitmaps this size? :confused: I would be very greatful if anyone can help me! :) Silka

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      silka_c# wrote: I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps. Why don't you use something like BitBlt? GDI (not GDI+) is hardware accelerated and highly portable between cards. Not to mention easier to use for the kind of thing you're tring to do. It's often used on simpler, 2D games and it's fast enough for most uses... I see dead pixels Yes, even I am blogging now!

      S 2 Replies Last reply
      0
      • D Daniel Turini

        silka_c# wrote: I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps. Why don't you use something like BitBlt? GDI (not GDI+) is hardware accelerated and highly portable between cards. Not to mention easier to use for the kind of thing you're tring to do. It's often used on simpler, 2D games and it's fast enough for most uses... I see dead pixels Yes, even I am blogging now!

        S Offline
        S Offline
        silka_c
        wrote on last edited by
        #3

        The Idea sounds good. I would give it a try. I searched a little bit in the web and the MSDN. How do I use BitBlt in C#. Did you use it in a c#-application and could you give me some code snippets? Thanks a lot for your help.:) Silka

        D 1 Reply Last reply
        0
        • S silka_c

          The Idea sounds good. I would give it a try. I searched a little bit in the web and the MSDN. How do I use BitBlt in C#. Did you use it in a c#-application and could you give me some code snippets? Thanks a lot for your help.:) Silka

          D Offline
          D Offline
          Daniel Turini
          wrote on last edited by
          #4

          Maybe this article[^] can be of some help. I see dead pixels Yes, even I am blogging now!

          1 Reply Last reply
          0
          • D Daniel Turini

            silka_c# wrote: I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps. Why don't you use something like BitBlt? GDI (not GDI+) is hardware accelerated and highly portable between cards. Not to mention easier to use for the kind of thing you're tring to do. It's often used on simpler, 2D games and it's fast enough for most uses... I see dead pixels Yes, even I am blogging now!

            S Offline
            S Offline
            silka_c
            wrote on last edited by
            #5

            Thanks again, Daniel. I made BitBlt work but it is not much faster than the old version with DrawImage(). Are there any other ideas? Thanks for your help. SILKA

            D 1 Reply Last reply
            0
            • S silka_c

              Thanks again, Daniel. I made BitBlt work but it is not much faster than the old version with DrawImage(). Are there any other ideas? Thanks for your help. SILKA

              D Offline
              D Offline
              Daniel Turini
              wrote on last edited by
              #6

              silka_c# wrote: Are there any other ideas? How fast do you need to go? 5000x4000 pixels == 5000x4000x4 bytes ~~ 76MB This should take a while to transfer over any bus... Besides that, do you really have a card/monitor that is able to display such a beast? I see dead pixels Yes, even I am blogging now!

              S 1 Reply Last reply
              0
              • D Daniel Turini

                silka_c# wrote: Are there any other ideas? How fast do you need to go? 5000x4000 pixels == 5000x4000x4 bytes ~~ 76MB This should take a while to transfer over any bus... Besides that, do you really have a card/monitor that is able to display such a beast? I see dead pixels Yes, even I am blogging now!

                S Offline
                S Offline
                silka_c
                wrote on last edited by
                #7

                Hi Daniel, sorry, I've been on vacation for a while. No, my monitor/ graphics card won't display the whole Image, that's why i started to think about resizing it to a moderate size. Do you know, how I can do it in Direct Draw? I'm right now trying to figure out how fast it would be with Direct Draw (Managed DirectX 9.0).

                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