Results 1 to 5 of 5

Thread: help me convert this to C# code

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Talking help me convert this to C# code

    VB Code:
    1. Dim cMatrix As New ColorMatrix(New Single()() _
    2.                                           {New Single() {0.299, 0.299, 0.299, 0, 0}, _
    3.                                            New Single() {0.587, 0.587, 0.587, 0, 0}, _
    4.                                            New Single() {0.114, 0.114, 0.114, 0, 0}, _
    5.                                            New Single() {0, 0, 0, 1, 0}, _
    6.                                            New Single() {0, 0, 0, 0, 1}})

    no luck so far
    I had posted this in the CodeBank section
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    like this you mean? ...
    VB Code:
    1. float[][] f = {
    2.     new float[] {0.299F, 0.299F, 0.299F, 0, 0},
    3.     new float[] {0.587F, 0.587F, 0.587F, 0, 0},
    4.     new float[] {0, 0, 0, 1, 0},
    5.     new float[] {0,  0,  0,  1, 0}};
    6.                 ColorMatrix cMatrix=new ColorMatrix(f);
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by dynamic_sysop
    like this you mean? ...
    VB Code:
    1. float[][] f = {
    2.     new float[] {0.299F, 0.299F, 0.299F, 0, 0},
    3.     new float[] {0.587F, 0.587F, 0.587F, 0, 0},
    4.     new float[] {0, 0, 0, 1, 0},
    5.     new float[] {0,  0,  0,  1, 0}};
    6.                 ColorMatrix cMatrix=new ColorMatrix(f);
    Many thanks!
    hmm I wonder why MS cant stick to the same keywords when switching languages. Why float in c# then single in VB? aah just be consistent, stupid MS, hehe
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    you could still use Single. Single is aprt of the .NET framework. I believe float is built into the C# specification and compiler..
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Cander
    you could still use Single. Single is aprt of the .NET framework. I believe float is built into the C# specification and compiler..
    hmm so basically they convert to the same thing when compiled, right?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width