SetDIBitsToDevice 或 StretchDIBits 怎样实现图像快速上下翻转?

cczlp 2006-09-26 09:38:06
记得以前把一个参数变为负就可以,现在怎么都试不出来, 是不是因为在DirectDraw中使用的原因?
...全文
716 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
boytomato 2006-10-24
  • 打赏
  • 举报
回复
gdi+中的

myBitmap.RotateFlip
e_feeling 2006-10-03
  • 打赏
  • 举报
回复
up
会思考的草 2006-09-26
  • 打赏
  • 举报
回复
BITMAPINFO里高度值符号改变就可以了。
jerry 2006-09-26
  • 打赏
  • 举报
回复
StretchBlt( dc, 0, 0, width, height, hMemDC, 0, y+height-1, width, -height, SRCCOPY);
pomelowu 2006-09-26
  • 打赏
  • 举报
回复
StretchBlt( dc, 0, 0, width, height, hMemDC, 0, y+height-1, width, -height, SRCCOPY);
booklove 2006-09-26
  • 打赏
  • 举报
回复
StretchBlt( dc, 0, 0, width, height, hMemDC, 0, height-1, width, -height, SRCCOPY);
cczlp 2006-09-26
  • 打赏
  • 举报
回复
nDestHeight置为负值图像显示不对.

一楼的没看明白.
goodboyws 2006-09-26
  • 打赏
  • 举报
回复
nDestHeight置为负值就可以
pomelowu 2006-09-26
  • 打赏
  • 举报
回复
In StretchBlt, or StretchDIBits, instead of using y with height, use y + height - 1 with - height
crumpy 2006-09-26
  • 打赏
  • 举报
回复
StretchDIBits
creates a mirror image of a bitmap if the signs of the nSrcWidth and nDestWidth parameters, or if the nSrcHeight and nDestHeight parameters differ. If nSrcWidth and nDestWidth have different signs, the function creates a mirror image of the bitmap along the x-axis. If nSrcHeight and nDestHeight have different signs, the function creates a mirror image of the bitmap along the y-axis.

crumpy 2006-09-26
  • 打赏
  • 举报
回复
mark...

StretchDIBits中改变Source Rectangle中Height的符号, 或者改变Destination Rectangle中Height的符号均可实现垂直翻转.

SetDIBitsToDevice好象不支持翻转.
vcPlayer 2006-09-26
  • 打赏
  • 举报
回复
BITMAPINFO里高度值符号改变就可以了。

============================================

资料里也这么说!可当我把它改为负值重新存储为新文件后,却不能用正常的绘图程序打开。

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧