maxritter / diy-thermocam

A do-it-yourself thermal imager, compatible with the FLIR Lepton 2.5, 3.1R and 3.5 sensor with Arduino firmware
http://www.diy-thermocam.net
GNU General Public License v3.0
1.1k stars 174 forks source link

Adding some text over the thermal imaging #67

Closed stephen94000 closed 3 years ago

stephen94000 commented 5 years ago

Hello,

I wanted to add a GPS to the Raspberry Pi Zero where the thermocam is connected. First, i wanted to try to add some text over the thermal imaging, but i failed... the screen.blit(mytext) just before screen.blit(thermalimage) is not taken in consideration... Have you guys have any clue ? Thanks Stephen

maxritter commented 5 years ago

In function displayThermalImage after "if thermalImg is None: return", you could add your text this way:

font = pygame.font.SysFont("Times New Roman", 26)
mystr = "GPS Text"
color = getTextColor()
text = font.render(mystr, 1, color)
textpos = text.get_rect()
textpos.centerx = thermalImg.get_rect().centerx
textpos.centery = thermalImg.get_rect().centery + 65
thermalImg.blit(text, textpos)