Join Bitmaps

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Is it possible to join 4 Bitmap objects into a single one and have the
result converted to a Byte[]?

Thank You,
Miguel
 
If you are targetting graphical rendering with WPF or Managed DirectX, you
can take a look at "Texture". Such a ressource can indeed contains multiple
'regions' (roof, each walls, ... ) inside one 'bitmap' and the rendering
relay on coordinates to reach the right sub-region
(http://msdn.microsoft.com/en-us/library/aa451368.aspx). Some editors are
available for free (such as Dxtex.exe,
http://msdn.microsoft.com/en-us/library/ee417856(VS.85).aspx). Sure, if you
want to create dynamically those textures, that is another problem.

Vanderghast, Access MVP
 
Is it possible to join 4 Bitmap objects into a single one and have the
result converted to a Byte[]?

Yes, it's possible, but there are no built-in methods to do this for you.
You'll have to create a new bitmap and then draw the 4 onto it. (Actually,
you could probably create the first bitmap from one and then only have to
draw the other three, but either way you're going to be using a Graphics
object.) Then to turn the resulting bitmap into a byte array you'll just use
the Save() method to write the data to a MemoryStream, from which you can
then extract a byte array.
 
Back
Top