X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/wx/tools/img2img.py?ds=sidebyside diff --git a/wxPython/wx/tools/img2img.py b/wxPython/wx/tools/img2img.py index a405fb112c..0f3595b359 100644 --- a/wxPython/wx/tools/img2img.py +++ b/wxPython/wx/tools/img2img.py @@ -8,25 +8,31 @@ # Copyright: (c) 2002 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/21/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o V2.5 compatability update +# +import getopt +import glob +import os +import sys -import sys, os, glob, getopt -from wxPython.wx import * - +import wx def convert(file, maskClr, outputDir, outputName, outType, outExt): if os.path.splitext(file)[1].lower() == ".ico": - icon = wxIcon(file, wxBITMAP_TYPE_ICO) - img = wxBitmapFromIcon(icon) + icon = wx.Icon(file, wx.BITMAP_TYPE_ICO) + img = wx.BitmapFromIcon(icon) else: - img = wxBitmap(file, wxBITMAP_TYPE_ANY) + img = wx.Bitmap(file, wx.BITMAP_TYPE_ANY) if not img.Ok(): return 0, file + " failed to load!" else: if maskClr: om = img.GetMask() - mask = wxMaskColour(img, maskClr) + mask = wx.Mask(img, maskClr) img.SetMask(mask) if om is not None: om.Destroy() @@ -38,7 +44,7 @@ def convert(file, maskClr, outputDir, outputName, outType, outExt): if img.SaveFile(newname, outType): return 1, file + " converted to " + newname else: - img = wxImageFromBitmap(img) + img = wx.ImageFromBitmap(img) if img.SaveFile(newname, outType): return 1, "ok" else: