After writing BMP file, image is flipped upside down

后端 未结 1 1344
耶瑟儿~
耶瑟儿~ 2020-12-21 14:31

I am using the following code:

f = fopen( _stringhelper.STR(\"%s.bmp\", filename), \"wb\" );
if( !f ) {
    _core.Error( ERC_ASSET, \"ncImageLoader::CreateIm         


        
相关标签:
1条回答
  • 2020-12-21 15:16

    Bitmaps are stored "upside-down", see more about that here:

    Why are bmps stored upside down?

    You could set the height as a negative value to have it displayed correctly. (-height)

    From MSDN site, BITMAPINFOHEADER:

    If biHeight is negative, the bitmap is a top-down DIB with the origin at the upper left corner.

    0 讨论(0)
提交回复
热议问题