GIFToWoWTexture/GIFConverter/TGASharpLib.cs
/// <summary>
/// Convert <see cref="TgaExtArea"/> to byte array. Warning: <see cref="ScanLineTable"/>,
/// <see cref="PostageStampImage"/>, <see cref="ColorCorrectionTable"/> not included,
/// because thea are can be not in the Extension Area of TGA file!
/// </summary>
/// <returns>Byte array.</returns>
Convert  to byte array. Warning: ,
,  not included,
because thea are can be not in the Extension Area of TGA file!
Convert to byte array . Warning : not included because thea are can be not in the Extension Area of TGA file!
public byte[] ToBytes()
        {
            #region Exceptions check
            if (authorName == null)
                authorName = new TgaString(41, true);
            if (authorComments == null)
                authorComments = new TgaComment();
            if (dateTimeStamp == null)
                dateTimeStamp = new TgaDateTime(DateTime.UtcNow);
            if (jobNameOrID == null)
                jobNameOrID = new TgaString(41, true);
            if (jobTime == null)
                jobTime = new TgaTime();
            if (softwareID == null)
                softwareID = new TgaString(41, true);
            if (softVersion == null)
                softVersion = new TgaSoftVersion();
            if (keyColor == null)
                keyColor = new TgaColorKey();
            if (pixelAspectRatio == null)
                pixelAspectRatio = new TgaFraction();
            if (gammaValue == null)
                gammaValue = new TgaFraction();
            #endregion
            return BitConverterExt.ToBytes(
                extensionSize,
                authorName.ToBytes(),
                authorComments.ToBytes(),
                dateTimeStamp.ToBytes(),
                jobNameOrID.ToBytes(),
                jobTime.ToBytes(),
                softwareID.ToBytes(),
                softVersion.ToBytes(),
                keyColor.ToBytes(),
                pixelAspectRatio.ToBytes(),
                gammaValue.ToBytes(),
                colorCorrectionOffset,
                postageStampOffset,
                scanLineOffset,
                (byte)attributesType,
                otherDataInExtensionArea);
        }
public byte [ ] ToBytes ( ) { region  Exceptions check if ( authorName == null ) authorName = new TgaString ( 41 , true ) ; if ( authorComments == null ) authorComments = new TgaComment ( ) ; if ( dateTimeStamp == null ) dateTimeStamp = new TgaDateTime ( DateTime . UtcNow ) ; if ( jobNameOrID == null ) jobNameOrID = new TgaString ( 41 , true ) ; if ( jobTime == null ) jobTime = new TgaTime ( ) ; if ( softwareID == null ) softwareID = new TgaString ( 41 , true ) ; if ( softVersion == null ) softVersion = new TgaSoftVersion ( ) ; if ( keyColor == null ) keyColor = new TgaColorKey ( ) ; if ( pixelAspectRatio == null ) pixelAspectRatio = new TgaFraction ( ) ; if ( gammaValue == null ) gammaValue = new TgaFraction ( ) ; endregion return BitConverterExt . ToBytes ( extensionSize , authorName . ToBytes ( ) , authorComments . ToBytes ( ) , dateTimeStamp . ToBytes ( ) , jobNameOrID . ToBytes ( ) , jobTime . ToBytes ( ) , softwareID . ToBytes ( ) , softVersion . ToBytes ( ) , keyColor . ToBytes ( ) , pixelAspectRatio . ToBytes ( ) , gammaValue . ToBytes ( ) , colorCorrectionOffset , postageStampOffset , scanLineOffset , ( byte ) attributesType , otherDataInExtensionArea ) ; }
Convert  to byte array.
Convert to byte array .
None