- Timestamp:
- Dec 30, 2023, 2:20:44 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v2.9_Lars/classes/c/c_image/cwimage.c
r139 r140 151 151 case ACKEY_CREATE_SMALLBITMAP: 152 152 { 153 BOOL bLoaded=FALSE; 153 154 HBITMAP hbm; 154 155 PCREATEBMPINFO pCreateBMP=PVOIDFROMMP(mp1); … … 199 200 200 201 /* Check if in the meantime the bitmap was created */ 201 if(!_hBitmapSmall && _hBitmap) {202 if(!_hBitmapSmall) { 202 203 /* 203 204 FIXME: … … 206 207 207 208 Use a private work alike for wpQueryBitmapHandle instead??? 208 */ 209 209 210 Check if bitmap data already loaded. Keep the info so we don't discard the bitmap later on. Another 211 function may have requested the bitmap before. During wpQueryBitmapHandle() a normal size bitmap 212 is always created. We don't want to have memory wasted by the big one so it's discarded afterwards. 213 Not perfect, but works at the moment. Will be revamped later with automatic bitmap deletion. */ 214 if(_hBitmap) 215 bLoaded=TRUE; 216 210 217 if(_wpQueryBitmapHandle(pCreateBMP->wpObject, 211 218 &hbm, … … 218 225 _hBitmapSmall=hbm; 219 226 _ulSizeSmallBitmap=pCreateBMP->ulHeight; 227 if(!bLoaded) { 220 228 /* Discard the large bitmap now, we don't need it any more as we have 221 229 the small one. */ 222 230 GpiDeleteBitmap(_hBitmap); 223 231 _hBitmap=NULLHANDLE; 232 } 224 233 }/* _wpQueryBitmapHandle() */ 225 234 } … … 230 239 }/* for */ 231 240 }/* Try */ 232 CATCH(BITMAP_OBJECT) 233 { 241 CATCH(BITMAP_OBJECT) { 234 242 SysWriteToTrapLog("\nTrap occured in %s, file %s, around line %d.\n", 235 243 __FUNCTION__, __FILE__, __LINE__); 236 237 238 239 240 241 242 244 } END_CATCH; 245 _wpUnlockObject(pCreateBMP->wpObject); 246 // WinSendMsg(pCreateBMP->hwndCnr, CM_INVALIDATERECORD,MPFROMP(&pmrcToRefresh),MPFROM2SHORT(1,CMA_NOREPOSITION)); 247 // _wp_FreeMem(wpObject, (PBYTE)pCreateBMP); 248 free((PBYTE)pCreateBMP); 249 250 return (MRESULT) FALSE; 243 251 }/* case ACKEY_CREATE_SMALLBITMAP */ 244 252 case ACKEY_QUERY_BITMAPINFO:
Note:
See TracChangeset
for help on using the changeset viewer.