[pywin32-bugs] [ pywin32-Feature Requests-1374042 ] Improve GetBitmapBits()
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2005-12-06 02:29:16
|
Feature Requests item #1374042, was opened at 2005-12-06 15:29 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1374042&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stuart Woolford (swoolford) Assigned to: Nobody/Anonymous (nobody) Summary: Improve GetBitmapBits() Initial Comment: It would be a great enhancement to GetBitmapBits if it would return a string of the bitmap data, rather than a tuple of integers. The reasoning for this is that just about every other imaging library (for example PIL and wxPython) can handle data as a string of bytes, and converting to this is VERY slow. I would suggest perhaps there should be a GetBitmapBitsString() added.. As an example at present I have to: bmp=win32ui.CreateBitmapFromHandle(mybitmap) data=array.array('B',bmp.GetBitmapBits()).tostring() image=Image.fromstring("RGBA",size,data,"raw","BGRA" And the middle line takes around 0.7 seconds for 720x576x32bit, this is VERY slow. I would like to: bmp=win32ui.CreateBitmapFromHandle(mybitmap) data=bmp.GetBitmapBitsString() image=Image.fromstring("RGBA",size,data,"raw","BGRA" Which should take MUCH less time. This is currently an urgent problem, but the change is trivial and I will do it to my own copy, hopefully submitting a patch, although I dont usually do much C under windows. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1374042&group_id=78018 |