Dim myBitmap(8) as Bitmap
' ... init them
Dim scaleFactor as Float=1 ' or whatever
Dim W as int = scaleFactor*myBitmap(0).Width ' We are assuming that all bitmaps have equal dimensions.
Dim H as int = scaleFactor*myBitmap(0).Height
Dim totalW as int = 4*W ' Total width of 4*2 mosaic
Dim totalH as Int = 2*H ' Total height ...
Dim b as Bitmap
b.initializeMutable(totalW,totalH)
Dim cv as Canvas
cv.initialize2(b)
for r=0 to 1
for c=0 to 3
Dim dstRect as Rect
dstRect.initialize(c*W, r*H, (c+1)*W, (r+1)*H) '<-- each bitmap will be in a position in the mosaic. No spacing between bitmaps here
cv.drawBitmap( myBitmap(4*r+c), Null, dstRect)
next
next
' Now you have your bitmap in b and also in cv.bitmap. Can be saved to jpeg
Dim o As OutputStream
o=File.OpenOutput( Dir_dest, Filename_dest,False)
cv.Bitmap.WriteToStream(o,100,"JPEG") 'or "PNG"
o.Close