Hi, I am working with the PMOD MTDS display on the Arduino platform. I'd like to ask about the operation of the bit block transfer function, BitBlt(), when combining colour and monochrome bitmaps.
In the example code MtdsDemo1, function MtdsTest23(), there is an example of this which has some text rendered as colour loaded to noe section of the display and some monochrome-rendered text loaded to another section.
I would like to have a colour bitmap and a mono bitmap overlaid (e.g. each bitmap is the full size of the display). I'm using the ROP code ropSrcPaint to 'OR' the mono bitmap content with the colour bitmap. This causes corruption in the resulting image, however.
FYI, I can successfully merge two mono or two colour bitmaps in this way, but it doesn't work with one colour and one mono bitmap. The following lines of code just outline how I'm creating and loading the bitmaps, but are hopefully enough to explain what I'm trying to do:
Question
jamesW
Hi, I am working with the PMOD MTDS display on the Arduino platform. I'd like to ask about the operation of the bit block transfer function, BitBlt(), when combining colour and monochrome bitmaps.
In the example code MtdsDemo1, function MtdsTest23(), there is an example of this which has some text rendered as colour loaded to noe section of the display and some monochrome-rendered text loaded to another section.
I would like to have a colour bitmap and a mono bitmap overlaid (e.g. each bitmap is the full size of the display). I'm using the ROP code ropSrcPaint to 'OR' the mono bitmap content with the colour bitmap. This causes corruption in the resulting image, however.
FYI, I can successfully merge two mono or two colour bitmaps in this way, but it doesn't work with one colour and one mono bitmap. The following lines of code just outline how I'm creating and loading the bitmaps, but are hopefully enough to explain what I'm trying to do:
hdsColor = mtds.GetDs();
hbmpColor = mtds.CreateBitmap(240, 320, 16);
mtds.SetDrawingSurface(hdsColor, hbmpColor);
hdsMono = mtds.GetDs();
hbmpMono = mtds.CreateBitmap(240, 320, 1);
mtds.SetDrawingSurface(hdsMono, hbmpMono);
mtds.BitBlt(hdsDisp, 0, 0, 240, 320, hdsColor, 0, 0, ropSrcCopy);
mtds.BitBlt(hdsDisp, 0, 0, 240, 320, hdsMono, 0, 0, ropSrcPaint);
This approach causes corruption in the resulting image.
If, however, I create the mono bitmap as 16 bit, it works fine (likewise, if I change the colour bitmap to 1 bit).
Perhaps this is expected behaviour, or maybe I'm missing something?
Thanks.
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.