TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
kennis_tw
NA
9
0
Problem runing bitmap with Scan0 and System.IntPtr
Feb 4 2005 3:28 PM
hi guys, i got a problem hope somebody can help me: i got b which is the bitmap (entire picture 640*480), but i just need to scan a little part from that bitmap, this dimension is 110*110, but the following code is not doing what i need! help me pls! note:i dont want to cut the region 110*110 to scan. BitmapData bmData = b.LockBits(new Rectangle(0, 0, 110, 110), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb); int stride = bmData.Stride; // bytes in a row 3*b.Width System.IntPtr Scan0 = bmData.Scan0; byte * p = (byte *)(void *)Scan0; //int nOffset = stride - b.Width*3; int nOffset = stride - 110*3; for(int y=0;y < 110;++y) { for(int x=0; x < 110; ++x ) { do something... p += 3; --->why+3? } p += nOffset; --->what this line does? } b.UnlockBits(bmData);
Reply
Answers (
2
)
Draw on secondary Monitor
I can't control the color of the brush