Re: Help: Graphic & Video Objects
Quote:
Originally Posted by variant
Does the binary object automatically "convert" the files to binary, as far as I new I thought all files also used hexadecimals along with binany.
Binary, hexadecimal and decimal are just different ways of writing down the same number. The contents of the file are always binary, as this is how a computer operates internally.
You're probably thinking of using a "hex editor" to edit a file by hand. The contents of the file aren't actually hexadecimal, it's just more convenient to read and edit than decimal or binary.
Re: Help: Graphic & Video Objects
Hi Dynasoft,
How does the object accepts the values and interpret the value in using the Expression 'Get byte at' and 'get string at'
byte( "Binary object", > Enter value here <)
string$( "Binary object", > Enter value here <, > Enter value here <)
Can you recommend some links to become familiar with the terminologies of the binary object?
With Respect
Re: Help: Graphic & Video Objects
There should be a help file somewhere, but the first value for both is going to be the location in the file (as a decimal number). The second for the string is either going to be the end location, fixed length of the string to get, or a max length of the string (stopping at a "null" character if there is one before the max length).
Re: Help: Graphic & Video Objects
Hi Dynasoft,
Yes I have seen the help file. But the problem is that I have to convert the readings to see the binary representation if not what do I do wrong in this file ?
Thanks
Re: Help: Graphic & Video Objects
Hi,
Unfortunatly there is some thing wrong with the binary object as I used Binary array object instead and the readindgs are satisfactory but stil the problem is that the readings must be converted to get the binary representation.
With Regards
Re: Help: Graphic & Video Objects
I don't remember whether MMF has a binary$() function, but it definitely has a hex$() function. Try that.
Re: Help: Graphic & Video Objects
Hi Dynasoft,
MMF has both binary$() and hex$() function which makes it strange that why load binary file is not provided.
I think as it is, the best way is the use of dotnet object.
With respect
Re: Help: Graphic & Video Objects
Files aren't really stored as binary*. They're stored as bytes, which are integer numbers in the inclusive range of 000-255 (decimal), 00-FF (hex) and 00000000-11111111 (binary).
*Hard-disks store files as magnetic polarisation. Optical disks store files as reflectivity. When transmitted over wire, it's common to represent an entire byte in one go as a combination of frequency and phase, rather than individual bits, because you can transmit much faster that way. See QAM
The binary object works fine.
The str$(), hex$() and binary$() functions convert a number to decimal, hex and binary strings respectively. They're only for display to the user, because after doing any of those they aren't numbers as far as the computer is concerned any more.
Re: Help: Graphic & Video Objects
the binary reperesentation of RGBW.bmp in file
is suposed to be the fowlowing
01000010 01001101 01000110 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00110110 00000000
00000000 00000000 00101000 00000000
00000000 00000000 00000010 00000000
00000000 00000000 00000010 00000000
00000000 00000000 00000001 00000000
00011000 00000000 00000000 00000000
00000000 00000000 00010000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
00000000 00000000 11111111 00000000
00000000 11111111 11111111 11111111
00000000 00000000 00000000 00000000
11111111 00000000 11111111 00000000
00000000 00000000
but it is not represented so in the way I have used the binary object in the example. byte 54,57,57,59,64,66 are not read corectly no matter how I try to present them. Am I not approching the Binary object Correct?
Thanks for the link. I think I will red that carefully tomorrow.
Regards
Re: Help: Graphic & Video Objects
I guess you're getting "signed" bytes out of the binary object. They're exactly the same, just how you convert them to other forms is different. Including how the binary object converts them to the signed 32-bit integers and 64-bit floating point numbers MMF uses internally.
8-bit Binary: 10000000 - 11111111
Convert to decimal (unsigned): 128 - 255
Convert to decimal (signed): -128 - -1
Convert to 16-bit (unsigned, add 0s to start): 00000000.10000000 - 00000000.11111111
Convert to 16-bit (signed, clone first digit): 11111111.10000000 - 11111111.11111111
(I didn't want to write out 32 bits, but it's the same idea)