What would be the best way to concatenate an array of memory blocks into 1 memory block?
Using old style MemoryBlocks (untested, maybe typos, but you get the idea)
[code]//given MemoryBlocks mem1, mem2
dim joinedMem As new MemoryBlock(mem1.Size + mem2.Size)
joinedMem.StringValue(0, mem1.Size) = mem1.StringValue(0, mem1.Size)
joinedMem.StringValue(mem1.Size, mem2.Size) = mem2.StringValue(0, mem2.Size)[/code]
Not sure how to do it with new style MemoryBlocks.
In the new framework, one uses a Xojo.Core.MutableMemoryBlock Append method :
http://developer.xojo.com/xojo-core-mutablememoryblock$Append
[quote=205566:@Will Shank]Using old style MemoryBlocks (untested, maybe typos, but you get the idea)
[code]//given MemoryBlocks mem1, mem2
dim joinedMem As new MemoryBlock(mem1.Size + mem2.Size)
joinedMem.StringValue(0, mem1.Size) = mem1.StringValue(0, mem1.Size)
joinedMem.StringValue(mem1.Size, mem2.Size) = mem2.StringValue(0, mem2.Size)[/code]
Not sure how to do it with new style MemoryBlocks.[/quote]
If you’re going to do that, make sure the endianess is the same on both of them.
[quote=205570:@Michel Bujardet]In the new framework, one uses a Xojo.Core.MutableMemoryBlock Append method :
http://developer.xojo.com/xojo-core-mutablememoryblock$Append[/quote]
Could this same method be used to join 2 images of say .jpeg together to form one large image ?
I would rather use a couple DrawPicture on a larger picture graphic object.