Hi. I’m in the process of updating to Phoenix and the gradient text doesn’t render anymore (example).
This is the code I was using in wx 2:
def get_gradient_text_solid_bg(text,font,font_style,point_size,top_colour,bottom_colour,bg_colour_tuple):
dc=wx.MemoryDC()
f=getFont(font,font_style)
f.SetFaceName(font)
f.SetPointSize(point_size)
dc.SetFont(f)
dc.SelectObject(wx.Bitmap(0,0,settings.DEFAULT_BITMAP_DEPTH))
w,h= dc.GetTextExtent(text)
template_bmp= wx.Bitmap(w,h,settings.DEFAULT_BITMAP_DEPTH)
dc.SelectObject(template_bmp)
dc.SetBackground(wx.Brush(settings.BG_COLOUR))
dc.Clear()
dc.DrawText(text,0,0)
dc.SelectObject(wx.NullBitmap)
template_image= template_bmp.ConvertToImage()
template_bmp= template_image.ConvertToBitmap()
text_bmp= wx.Bitmap(w,h,settings.DEFAULT_BITMAP_DEPTH)
dc.SelectObject(text_bmp)
dc.GradientFillLinear((0,0,w,h),top_colour,bottom_colour,wx.SOUTH)
dc.DrawBitmap(template_bmp,0,0)
dc.SelectObject(wx.NullBitmap)
return text_bmp
I looked at the differences between the two versions but couldn’t find anything.
Any pointers would be much appreciated.
Thanks!
···
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/8925de27-95b9-4f23-900a-06b9f65315b6%40googlegroups.com.