void Update(DisplayImage img) { //display.ClearDisplayBuf(); this.DrawBody(img); this.display.Display(); }
void DrawBody(DisplayImage img) { // Row 0, and image this.display.WriteImageDisplayBuf(img, 0, 1); // Row 1 - 3 //display.WriteLineDisplayBuf("Hello", 0, 1); //display.WriteLineDisplayBuf("World", 0, 2); }
public void AppendImage(DisplayImage image, uint col, uint row) { if (this.display.State == SSD1603.States.Ready) { for (uint i = col; i < 15; i++) { char value = ' '; this.display.WriteCharDisplayBuf(value, i, row); } this.display.Display(); this.display.WriteImageDisplayBuf(image, col, row); this.display.Display(); } else { Debug.Write("Display not ready!"); } }
public UInt32 WriteImageDisplayBuf(DisplayImage img, UInt32 Col, UInt32 Row) { /* Make sure we're drawing within the boundaries of the screen buffer */ UInt32 MaxRowValue = (this.SCREEN_HEIGHT_PAGES / img.ImageHeightBytes) - 1; UInt32 MaxColValue = (UInt32)this.Screen.WidthInPixel; if (Row > MaxRowValue) { return(0); } if ((Col + img.ImageWidthPx + DisplayFontTable.FontCharSpacing) > MaxColValue) { return(0); } UInt32 CharDataIndex = 0; UInt32 StartPage = Row * 2; //0 UInt32 EndPage = StartPage + img.ImageHeightBytes; //2 UInt32 StartCol = Col; UInt32 EndCol = StartCol + img.ImageWidthPx; UInt32 CurrentPage = 0; UInt32 CurrentCol = 0; /* Copy the character image into the display buffer */ for (CurrentCol = StartCol; CurrentCol < EndCol; CurrentCol++) { for (CurrentPage = StartPage; CurrentPage < EndPage; CurrentPage++) { this.DisplayBuffer[CurrentCol, CurrentPage] = img.ImageData[CharDataIndex]; CharDataIndex++; } } /* Return the number of horizontal pixels used by the character */ return(CurrentCol - StartCol); }