~edwin-grubbs/python-imaging/trunk

« back to all changes in this revision

Viewing changes to PIL/ImageWin.py

  • Committer: effbot
  • Date: 2006-07-05 20:36:11 UTC
  • Revision ID: svn-v4:be285980-f00d-0410-a9fe-d4747b46ecd0:pil:348
Load Imaging-1.1.6b1 into pil.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
# The Python Imaging Library.
3
 
# $Id: ImageWin.py 2545 2005-10-03 10:29:49Z fredrik $
 
3
# $Id: ImageWin.py 2662 2006-03-21 22:41:02Z fredrik $
4
4
#
5
5
# a Windows DIB display interface
6
6
#
115
115
    # palette entries were changed, and the image should be
116
116
    # redrawn.
117
117
    #
118
 
    # @param dc Device context (HDC), cast to a Python integer,
 
118
    # @param handle Device context (HDC), cast to a Python integer,
119
119
    #     or an HDC or HWND instance.
120
120
    # @return A true value if one or more entries were changed
121
121
    #    (this indicates that the image should be redrawn).
122
122
 
123
 
    def query_palette(self, dc):
 
123
    def query_palette(self, handle):
124
124
        if isinstance(handle, HWND):
125
 
            dc = self.image.getdc(handle)
 
125
            handle = self.image.getdc(handle)
126
126
            try:
127
 
                result = self.image.query_palette(dc)
 
127
                result = self.image.query_palette(handle)
128
128
            finally:
129
 
                self.image.releasedc(handle, dc)
 
129
                self.image.releasedc(handle, handle)
130
130
        else:
131
131
            result = self.image.query_palette(handle)
132
132
        return result