graphics - How do I successfully draw a bitmap onto another bitmap? -
i've been trying map stuff game i'm working with. i'm looking display 9 map files (which i've read , processed, , have function converts these map files bitmap objects).
basically have array of bitmaps, , big bitmap. each little bitmap 256x256, , big 1 768x768, , want draw them @ right offsets (so lines up, each bitmap designed next predecessor, until end of row, @ point column used start next 3, , on).
what i'm doing @ minute:
(int = 0; < 9; i++) { bmplist[i] = getmapfile(sb[i].tostring()); } using (graphics g = graphics.fromimage(bmp)) { g.drawimage(bmplist[0], 256, 0, 256, 256); g.drawimage(bmplist[1], 512, 0, 256, 256); g.drawimage(bmplist[2], 0, 256, 256, 256); g.drawimage(bmplist[3], 256, 256, 256, 256); g.drawimage(bmplist[4], 512, 256, 256, 256); g.drawimage(bmplist[5], 0, 512, 256, 256); g.drawimage(bmplist[6], 256, 512, 256, 256); g.drawimage(bmplist[7], 512, 512, 256, 256); g.drawimage(bmplist[8], 0, 0, 256, 256); } the result bmp blank image (when convert image.source, displays nothing. prove rest of code i've done this:
rectangle rect = new rectangle(); rect.height = 256; rect.width = 512; rect.x = 0; rect.y = 0; objects.colour color = new objects.colour(); color = colourlist[0]; graphics.fromimage(bmp).fillrectangle(new solidbrush(color.fromargb(color.r, color.g, color.b)), rect); and draws black rectangle expected, of 256 height , 512 width. i've changed these numbers fill rectangle, too, isn't problem.
anyone know i'm doing wrong? help much appreciated!
thanks in advance
the reply there nil wrong above code, , passing file path incorrectly function. bad, anyway!
graphics map bitmap draw
No comments:
Post a Comment