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. Bitmap Outputing Characters

Bitmap Outputing Characters

Scheduled Pinned Locked Moved C#
graphicsperformancequestion
10 Posts 3 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.
  • E Offline
    E Offline
    Expert Coming
    wrote on last edited by
    #1

    I have some code that creates an image by putting a bunch of images together. If I return the result as a JPEG or GIF it works fine. But when I return it as a BMP it returns a bunch or characters instead of a picture. Any ideas on why?

    The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

    B C 2 Replies Last reply
    0
    • E Expert Coming

      I have some code that creates an image by putting a bunch of images together. If I return the result as a JPEG or GIF it works fine. But when I return it as a BMP it returns a bunch or characters instead of a picture. Any ideas on why?

      The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

      B Offline
      B Offline
      bobsugar222
      wrote on last edited by
      #2

      Can you clarify what you mean by 'return the result'. Are you using a Bitmap object?

      myBitmap.Save("bitmap.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

      E 1 Reply Last reply
      0
      • B bobsugar222

        Can you clarify what you mean by 'return the result'. Are you using a Bitmap object?

        myBitmap.Save("bitmap.bmp", System.Drawing.Imaging.ImageFormat.Bmp);

        E Offline
        E Offline
        Expert Coming
        wrote on last edited by
        #3

        Yes I am using a Bitmap object. The wierd part is it works if it is a JPEG or GIF, not BMP... myBitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Bmp);

        The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

        1 Reply Last reply
        0
        • E Expert Coming

          I have some code that creates an image by putting a bunch of images together. If I return the result as a JPEG or GIF it works fine. But when I return it as a BMP it returns a bunch or characters instead of a picture. Any ideas on why?

          The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          What object are you returning, to see a 'bunch of characters' ? Why do people ask questions like this and not post the code ? If you write code that returns a Bitmap, you'll get a bitmap. If you're not getting that, we need to see the code to say what's wrong with it.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          E 1 Reply Last reply
          0
          • C Christian Graus

            What object are you returning, to see a 'bunch of characters' ? Why do people ask questions like this and not post the code ? If you write code that returns a Bitmap, you'll get a bitmap. If you're not getting that, we need to see the code to say what's wrong with it.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            E Offline
            E Offline
            Expert Coming
            wrote on last edited by
            #5

            Code Removed -- modified at 20:30 Monday 26th February, 2007

            The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

            C 1 Reply Last reply
            0
            • E Expert Coming

              Code Removed -- modified at 20:30 Monday 26th February, 2007

              The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              OK, it's an ASP.NET question. You should ask those in the ASP.NEt forum, or at least make that clear. Why on earth would you send a BMP through a web page anyhow, when gif and jpg are smaller ? I would not be surprised in the browser does not support them, I think BMP is a windows format ( it's raw data with a header which I think is Windows specific ).

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              E 1 Reply Last reply
              0
              • C Christian Graus

                OK, it's an ASP.NET question. You should ask those in the ASP.NEt forum, or at least make that clear. Why on earth would you send a BMP through a web page anyhow, when gif and jpg are smaller ? I would not be surprised in the browser does not support them, I think BMP is a windows format ( it's raw data with a header which I think is Windows specific ).

                Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                E Offline
                E Offline
                Expert Coming
                wrote on last edited by
                #7

                I have seen that a way to make dynamic images is to use an aspx page with a Response.OutputStream and then assign that page as the ImageUrl in a Image Component. It works for JPEG and GIF. My problem is transparency. JPEG and GIF output results in a black background. I guess I could ask, how do I get the background of my outputed JPEG or GIF image to be transparent? Or do you know another way to make my own image and output it on a custom control? And I did forget to mention it is a ASP.NET app, so keep that in mind.

                The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

                C 1 Reply Last reply
                0
                • E Expert Coming

                  I have seen that a way to make dynamic images is to use an aspx page with a Response.OutputStream and then assign that page as the ImageUrl in a Image Component. It works for JPEG and GIF. My problem is transparency. JPEG and GIF output results in a black background. I guess I could ask, how do I get the background of my outputed JPEG or GIF image to be transparent? Or do you know another way to make my own image and output it on a custom control? And I did forget to mention it is a ASP.NET app, so keep that in mind.

                  The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #8

                  There certainly is no transparency support in BMP. I believe PNG is the only format that has transparency built in.

                  Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                  E 1 Reply Last reply
                  0
                  • C Christian Graus

                    There certainly is no transparency support in BMP. I believe PNG is the only format that has transparency built in.

                    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                    E Offline
                    E Offline
                    Expert Coming
                    wrote on last edited by
                    #9

                    .NET has a method MakeTransparent(Color), when you use that method it simply doesn't draw the pixels with the color passed to MakeTransparent. I have another idea. How can I pass a Color from one page to another?

                    The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

                    E 1 Reply Last reply
                    0
                    • E Expert Coming

                      .NET has a method MakeTransparent(Color), when you use that method it simply doesn't draw the pixels with the color passed to MakeTransparent. I have another idea. How can I pass a Color from one page to another?

                      The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

                      E Offline
                      E Offline
                      Expert Coming
                      wrote on last edited by
                      #10

                      Ok, I made a variable and it always used the default I set to it since I commented out a line for testing. I uncommented have it works. Those are the errors I love!

                      The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.

                      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