Simply C# To VB.net?

  • Thread starter Thread starter Smoke
  • Start date Start date
S

Smoke

This may sound stupid, but how do u convert this Enum to VB.net ? what values are those? i dont think put them as string will
work...

public enum KnownEXIFIDCodes
{
JpegIFOffset = 0x0201,
JpegIFByteCount =0x0202,
YCbCrSubSampling =0x0212 ,
}

Thanks... ?
 
Those are hexadecimal representations of numbers. You can define a normal
enum in VB and assign it values two ways:
1. Convert the hex to decimal and assign the decimal values
2. Assign hex values using &H in VB instead of 0x0
 
Smoke said:
This may sound stupid, but how do u convert this Enum to VB.net ? what
values are those? i dont think put them as string will
work...

public enum KnownEXIFIDCodes
{
JpegIFOffset = 0x0201,
JpegIFByteCount =0x0202,
YCbCrSubSampling =0x0212 ,
}

\\\
Public Enum KnownExifIDCodes
JpegIFOffset = &H201
JpegIFByteCount = &H202
YCbCrSubSampling = &H212
End Enum
///
 
This seems to be pretty good, but i may look really stup**d asking this...
I did replaced all 0x0* for &H* but what does i do with those for example?

UnknownCode = "0x0"
Copyright = "0x8298"
ExifVersion = "0x9000"
Flash = "0x9209"
CFAPattern = "0xa302"
InteroperabilityIndex = "0x01"
InteroperabilityVersion = "0x02"

Those lost my idea of just replace 0x0, or i should replace 0x for &H only and 0x0201 is equal to &H0201 ?

Thanks....
 
0x is just C#'s means of specifying a hex constant. 0x0 is simply, 0
or &H0 in VB. Since these are integer values and, indeed, all enums in
VB are integral types, you should not enclose them in quotation marks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top