C# -> VB translation

  • Thread starter Thread starter bgt
  • Start date Start date
B

bgt

Hi,

I found a lot of comparison tables for these languages but I couldn't
find how to translate the following:

ColorMatrix cm=new ColorMatrix();
cm.Matrix00=cm.Matrix11=cm.Matrix22=0.99f;
cm.Matrix33=cm.Matrix44=1;
cm.Matrix40=cm.Matrix41=cm.Matrix42=.04f;

Can anyone help me with that ?

Thanks,

Bart
 
bgt said:
Hi,

I found a lot of comparison tables for these languages but I couldn't
find how to translate the following:

ColorMatrix cm=new ColorMatrix();
cm.Matrix00=cm.Matrix11=cm.Matrix22=0.99f;
cm.Matrix33=cm.Matrix44=1;
cm.Matrix40=cm.Matrix41=cm.Matrix42=.04f;

Can anyone help me with that ?

Thanks,

Bart

This should be helpful.

http://msdn.microsoft.com/en-us/library/system.drawing.imaging.colormatrix.item.aspx

Dim instance As ColorMatrix
Dim row As Integer
Dim column As Integer
Dim value As Single

value = instance.Item(row, column)

instance.Item(row, column) = value
 
The conversion (via Instant VB) is:
Dim cm As New ColorMatrix()
cm.Matrix22=0.99f
cm.Matrix11=cm.Matrix22
cm.Matrix00=cm.Matrix11
cm.Matrix44=1
cm.Matrix33=cm.Matrix44
cm.Matrix42=.04f
cm.Matrix41=cm.Matrix42
cm.Matrix40=cm.Matrix41

However, you might prefer the following:
Dim cm As New ColorMatrix()
cm.Matrix22=0.99f
cm.Matrix11=0.99f
cm.Matrix00=0.99f
cm.Matrix44=1
cm.Matrix33=1
cm.Matrix42=.04f
cm.Matrix41=.04f
cm.Matrix40=.04f
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
 
Back
Top