On 04/04/2019 12:11, Bill Somerville wrote:
' The Xojo Color type stores 8-bit per channel colour values ' so we can start with one of them and extend to the 16-bit ' per channel Qt's deep colour QColor type uses '' Let's start with a light green Color variable Dim c As Color = &c007f00 ' Defaults to Alpha value 0 ' Assuming os is a ByteStream instance set to BigEndian mode ' we write a serialized QColor version of light_green like this os.WriteUInt8 (1) ' RGB spec os.WriteUInt16 (c.Alpha) os.WriteUInt16 (c.Red) os.WriteUint16 (c.Green) os.WriteUInt16 (c.Blue) os.WriteUInt16 (0) ' padding ' To stream an invalid QColor value (needed to clear colours) os.WriteUInt8 (0) ' Invalid spec For i As Integer = 1 To 4 os.WriteUInt16 (0) Next
Hi again Ed, corrected for the dumb off-by-one error. ' The Xojo Color type stores 8-bit per channel colour values ' so we can start with one of them and extend to the 16-bit ' per channel Qt's deep colour QColor type uses ' ' Let's start with a light green Color variable Dim c As Color = &c007f00 ' Defaults to Alpha value 0 ' Assuming os is a ByteStream instance set to BigEndian mode ' we write a serialized QColor version of light_green like this os.WriteUInt8 (1) ' RGB spec os.WriteUInt16 (c.Alpha) os.WriteUInt16 (c.Red) os.WriteUint16 (c.Green) os.WriteUInt16 (c.Blue) os.WriteUInt16 (0) ' padding ' To stream an invalid QColor value (needed to clear colours) os.WriteUInt8 (0) ' Invalid spec For i As Integer = 1 To 5 os.WriteUInt16 (0) Next 73 Bill G4WJS.
_______________________________________________ wsjt-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wsjt-devel
