title: Building NSImage from bytes
body: <p>Im trying to build an NSImage from some strange bytes.
  Im using BlackMagic SDK to get the bytes of a recieved frame:</p>
  
  <pre><code>unsigned char* frame3 = NULL;
  unsigned char* frame2 = (Byte*)malloc(699840);
  
  videoFrame-&gt;GetBytes ( (void**)&amp;frame3);
  memcpy(frame2, frame3, 699840);
  
  NSData* data = [NSData dataWithBytes:frame2 length:sizeof(frame2) ];
  NSImage *image = [[NSImage alloc] initWithData:data];
  
  //(till now i use statically 699840, because i know its size)
  </code></pre>
  
  <p>Why i said the bytes are strange is that the content of the "frame2" looks like this:</p>
  
  <pre><code>printf("content: %s",frame2);
  </code></pre>
  
  <blockquote>
    <p>\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200\200.........\200 (to the end)</p>
  </blockquote>
  
  <p>It should be blank black frame.</p>
  
  <p>Does somebody know how could I figure out something with this?</p>