All pastes #746064 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-10-22 22:32 UTC
rendered paste body
    def makeBitmap(self, gc, text):
        gc.SetFont(self._font)
        width, height = gc.GetTextExtent(text)
        bitmap = wx.EmptyBitmap(width + 2*WEEKDAY_PADDING, height)
        mdc = wx.MemoryDC(bitmap)
        mdc.SetFont(self._font)
        mdc.SetBackground(wx.BLACK_BRUSH)
        mdc.Clear()
        mdc.DrawText(text, 0, 0)
        gc.DrawBitmap(bitmap, 0, 0, *bitmap.GetSize())
        
        return bitmap