Any Suggestin about shrink/ stretch a BMP?
-
try that function.....CDC::StretchBlt :-D
-
try that function.....CDC::StretchBlt :-D
I knew that...;P Maybe need to talk in more detail... Some function would provide the BITMAPINFOHEADER and Bitmap buffer data. I wanna change the size of the resulting BMP. The step I thought was that: 1. call CreateCompatibleDC( ) to create a memory DC. 2. call CreateCompatibleBitmap( ), get the handle of a bitmap and use last-created memory DC to select it. 3. call memcpy( ) to copy the data to the last-created compatible bitmap. 4. call StretchBlt( ) from the memory DC to the dialog DC( or memory DC number 2 ). For I need to save time, the data of the BMP after stretch need to be saved. So...the following work may required to be done only once. 5. call GetCurrentBitmap for the dialog DC( or memory DC number 2 ). 6. call CBitmap::GetBitmapBits( ), get the data( upset-down, need to flip. ) 7. CreateDIBSection( ) for the new data in new size. 8. OK, next time when repaint is required, simply use a memory DC to select these bitmap handles and call BitBlt from a memory DC to dialog DC. ( The steps concerning with the deleting of some temp GDI objects are omitted. ) OMG! Too many steps... Is there a simpler way than that? Thanks!
-
I knew that...;P Maybe need to talk in more detail... Some function would provide the BITMAPINFOHEADER and Bitmap buffer data. I wanna change the size of the resulting BMP. The step I thought was that: 1. call CreateCompatibleDC( ) to create a memory DC. 2. call CreateCompatibleBitmap( ), get the handle of a bitmap and use last-created memory DC to select it. 3. call memcpy( ) to copy the data to the last-created compatible bitmap. 4. call StretchBlt( ) from the memory DC to the dialog DC( or memory DC number 2 ). For I need to save time, the data of the BMP after stretch need to be saved. So...the following work may required to be done only once. 5. call GetCurrentBitmap for the dialog DC( or memory DC number 2 ). 6. call CBitmap::GetBitmapBits( ), get the data( upset-down, need to flip. ) 7. CreateDIBSection( ) for the new data in new size. 8. OK, next time when repaint is required, simply use a memory DC to select these bitmap handles and call BitBlt from a memory DC to dialog DC. ( The steps concerning with the deleting of some temp GDI objects are omitted. ) OMG! Too many steps... Is there a simpler way than that? Thanks!
;)wow.....try using directx9 functionz.....that may help..... check thiz out..... http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/htm/resizeflags.asp[^] dunno if that helpz u out..... anyway..... Happy Programmin..... Cheerz..... :-D