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. C# .NET question

C# .NET question

Scheduled Pinned Locked Moved C#
csharpc++questionjavavisual-studio
12 Posts 7 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.
  • Z Offline
    Z Offline
    zimbar
    wrote on last edited by
    #1

    C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.

    A J C F 4 Replies Last reply
    0
    • Z zimbar

      C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.

      A Offline
      A Offline
      Andy Smith
      wrote on last edited by
      #2

      Zimbar wrote: My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? no, c# does not compile to a win32 executable. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) except for very extreme examples ( like maybe a game engine or something ), c# will be fast enough.

      1 Reply Last reply
      0
      • Z zimbar

        C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.

        J Offline
        J Offline
        James T Johnson
        wrote on last edited by
        #3

        Zimbar wrote: My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? No, the C# compiler only compiles down to MSIL bytecode. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) Probably not; but you could always try it to see. James "Java is free - and worth every penny." - Christian Graus

        1 Reply Last reply
        0
        • Z zimbar

          C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.

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

          Zimbar wrote: ++? Or it only compiles to bytecode like Java? That is sort of right. But yes, you need the runtime. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) No. My graphics filters were benchmarked by Chris L. and the same code in C++ was 25 times the speed. I wrote mine in C# only because I needed to, to differentiate them from some I wrote in C++ for a former employer. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

          E 1 Reply Last reply
          0
          • C Christian Graus

            Zimbar wrote: ++? Or it only compiles to bytecode like Java? That is sort of right. But yes, you need the runtime. Zimbar wrote: Do you think that C# is good for Graphics Applications? (I mean is it fast enough) No. My graphics filters were benchmarked by Chris L. and the same code in C++ was 25 times the speed. I wrote mine in C# only because I needed to, to differentiate them from some I wrote in C++ for a former employer. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

            E Offline
            E Offline
            Eric Gunnerson msft
            wrote on last edited by
            #5

            25x? That seems surprising. Care to share a bit of code (both in C++ and in C#)?

            C 1 Reply Last reply
            0
            • E Eric Gunnerson msft

              25x? That seems surprising. Care to share a bit of code (both in C++ and in C#)?

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

              My C# code is here on the site - I did not think the speed was too bad ( but I maintain C# is the wrong tool, mostly because Microsoft in their wisdom have made pixel access 'unsafe' ), but Chris Losinger has posted the question based on conversion to C++ that he did. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

              A 1 Reply Last reply
              0
              • C Christian Graus

                My C# code is here on the site - I did not think the speed was too bad ( but I maintain C# is the wrong tool, mostly because Microsoft in their wisdom have made pixel access 'unsafe' ), but Chris Losinger has posted the question based on conversion to C++ that he did. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

                A Offline
                A Offline
                Anonymous
                wrote on last edited by
                #7

                Two questions: 1) Was the code written using GetPixel and SetPixel()? 2) What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based.

                C 1 Reply Last reply
                0
                • A Anonymous

                  Two questions: 1) Was the code written using GetPixel and SetPixel()? 2) What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based.

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

                  Anonymous wrote: Was the code written using GetPixel and SetPixel()? Mine was not, that would not be unsafe. I assume Chris' was not either - he writes an imaging library, you know. Anonymous wrote: What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based. The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

                  E 1 Reply Last reply
                  0
                  • Z zimbar

                    C# .NET question My first and main question is: Can C# produce native executables, that would run on any Windows platoform without the .NET binaries? Just like C++? Or it only compiles to bytecode like Java? (it doesn't matter how MS calls it?) Do you think that C# is good for Graphics Applications? (I mean is it fast enough) I would like to try .NET SDK and online documentation before I move to VS .NET. Do you know about any online books on C# (beside C# Language Specification and Thinking in C#)? I think a FAQ on C# would answer this question but so far I couldn't find any with the anwsers I want. Any help is appreciated. Thank you, Z.

                    F Offline
                    F Offline
                    Feng Qin
                    wrote on last edited by
                    #9

                    If you installed vs.net, you can find C# language sepecification document on VC# folder, and also you can find many resource on msdn online. I'm amumu, and you?

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      Anonymous wrote: Was the code written using GetPixel and SetPixel()? Mine was not, that would not be unsafe. I assume Chris' was not either - he writes an imaging library, you know. Anonymous wrote: What other option was there besides making pixel access unsafe? I don't like it either, but I can't see how you can be fast without being pointer-based. The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

                      E Offline
                      E Offline
                      Eric Gunnerson msft
                      wrote on last edited by
                      #10

                      Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.

                      C E 2 Replies Last reply
                      0
                      • E Eric Gunnerson msft

                        Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.

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

                        Eric Gunnerson (msft) wrote: Did the C++ version use pointer arithmetic, or did it use array indexing? Pointers, for speed. I appreciate all that you are saying, my point is more that C# should be able to access the bitmap data in one call, instead of using get/setpixel which is notoriously slow, and without having to write code that will be marked 'unsafe'. Ideally, I guess that means GDI+ should provide another call, or C# should sandbox the GetData call and return the data. This will be slower, of course, but I would not mind that if I had the option to go unsafe, but could do pixel access in some way that was as optimised as I could hope for without marking my code as unsafe. Christian come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002

                        1 Reply Last reply
                        0
                        • E Eric Gunnerson msft

                          Sorry that the last one came across as anonymous. Not sure why... Christian Graus wrote: The obvious option is a function that returns the bitmap as a 2D array. How do you think every array in memory is laid out ? There is no reason to regard it as unsafe to access the member data of the Bitmap class. Hmm. Did the C++ version use pointer arithmetic, or did it use array indexing? I agree that you can return a 2D array, but I don't that would help much in this case because: 1) multidimensional access in C# is a bit slower than single dimensional 2) Array indexing is slower than pointer arithmetic 3) The .NET classes are a thin layer on top of the unmanaged GDI+ functions. If you can't change that, then you'd have to copy from the unmanaged world to the managed world and back, which would be really slow. #3 is a design decision which I hope can be addressed in the future. I'm not sure what we'd do to address the others. Thanks for the info; I'll take a look at the code.

                          E Offline
                          E Offline
                          Eric Gunnerson msft
                          wrote on last edited by
                          #12

                          I looked at the code, and it pretty much looks like my code. Is there anyplace I can look at the equivalent C++ code that Chris timed?

                          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