在使用GDI+中的Bitmap类时,经常使用LockBits函数来锁定一定区域,并读入内存进行操作。BitmapData类的Stride属性在MSND中的解释为:
Offset, in bytes, between consecutive scan lines of the bitmap. If the stride is positive, the bitmap is top-down. If the stride is negative, the bitmap is bottom-up.但是我在使用的时候经常犯错误,我还是不怎么理解Scan0这个属性和Stride的关系,经常会出现内存不可读问题,还有就是有关是4的倍数问题,在这里谁能帮我解释一下,Scan0在内存中是怎么存储的,怎么来访问,访问时Stride的作用是什么?
Offset, in bytes, between consecutive scan lines of the bitmap. If the stride is positive, the bitmap is top-down. If the stride is negative, the bitmap is bottom-up.但是我在使用的时候经常犯错误,我还是不怎么理解Scan0这个属性和Stride的关系,经常会出现内存不可读问题,还有就是有关是4的倍数问题,在这里谁能帮我解释一下,Scan0在内存中是怎么存储的,怎么来访问,访问时Stride的作用是什么?
解决方案 »
- Windows 外壳扩展之图标覆盖(IShellIconOverlayIdentifier)
- TrueCrypt 7.0 编译环境配置
- 我用delphi做的ocx和htm文件,不能正常打开,谁给个范例
- 把一个静态文本框改成一个带有滚动条的输出窗口
- 关于数据库打开的问题!!急于求助,谢谢
- VC新手:如何从CTime中取出整数型的年月日时分秒啊!并存入iYear,iMonth,iDay,iHour,iMinute,iSecond中呢?
- 那有VC做的界面源码下载,在线急等!
- 怎样播放AVI文件//急救!!
- 初学VC,简单问题,MFC里#include的详细用法
- 一个用托盘菜单控制的service程序,启动时有问题,请各位赐教,50分奉上不成敬意!
- byte 转换成 int型
- 新手TreeCtrl控件的问题
http://developer.51cto.com/art/200908/142998.htm