Click here to Skip to main content
15,885,278 members
Home / Discussions / C#
   

C#

 
GeneralRe: HELP Pin
Ravi Bhavnani22-Jul-14 4:16
professionalRavi Bhavnani22-Jul-14 4:16 
AnswerRe: HELP Pin
Ron Nicholson22-Jul-14 4:08
professionalRon Nicholson22-Jul-14 4:08 
GeneralRe: HELP Pin
Richard MacCutchan22-Jul-14 5:04
mveRichard MacCutchan22-Jul-14 5:04 
GeneralRe: HELP Pin
OriginalGriff22-Jul-14 6:19
mveOriginalGriff22-Jul-14 6:19 
AnswerRe: HELP Pin
Rob Philpott22-Jul-14 5:25
Rob Philpott22-Jul-14 5:25 
GeneralRe: HELP Pin
Eddy Vluggen22-Jul-14 5:53
professionalEddy Vluggen22-Jul-14 5:53 
Questionbitmap lockbits/unlockbits Pin
V.22-Jul-14 2:48
professionalV.22-Jul-14 2:48 
AnswerRe: bitmap lockbits/unlockbits Pin
Rob Philpott22-Jul-14 3:12
Rob Philpott22-Jul-14 3:12 
Hmm. Tricky, it sounds like things have got out of alignment.

As I recall, stride may not be exactly the width of a line as I think word alignment comes into it. (Not 100% on that). Also nrofbytes = stride * height * bits per pixel / 8. I don't think you array is large enough, multiply by 3 at least.

Also there seems to be some implicit assumption that you have one byte per RGB channel - is this guaranteed? Often you have an alpha channel as well which is nice as it makes each pixel a pleasing 32 bits. That might explain the greys you are seeing.

And I think:

for(int i = 0; i < bytes.Length-3; i+=3


should be:

for(int i = 0; i < bytes.Length; i+=3)

Regards,
Rob Philpott.

GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 3:32
professionalV.22-Jul-14 3:32 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 3:45
professionalKornfeld Eliyahu Peter22-Jul-14 3:45 
GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 22:29
professionalV.22-Jul-14 22:29 
QuestionRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 22:44
professionalKornfeld Eliyahu Peter22-Jul-14 22:44 
AnswerRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 22:51
professionalV.22-Jul-14 22:51 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 22:55
professionalKornfeld Eliyahu Peter22-Jul-14 22:55 
GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 23:10
professionalV.22-Jul-14 23:10 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 23:21
professionalKornfeld Eliyahu Peter22-Jul-14 23:21 
GeneralRe: bitmap lockbits/unlockbits Pin
V.23-Jul-14 2:05
professionalV.23-Jul-14 2:05 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter23-Jul-14 2:56
professionalKornfeld Eliyahu Peter23-Jul-14 2:56 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 3:24
professionalKornfeld Eliyahu Peter22-Jul-14 3:24 
GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 19:55
professionalV.22-Jul-14 19:55 
AnswerRe: bitmap lockbits/unlockbits Pin
Kornfeld Eliyahu Peter22-Jul-14 20:06
professionalKornfeld Eliyahu Peter22-Jul-14 20:06 
GeneralRe: bitmap lockbits/unlockbits Pin
V.22-Jul-14 20:13
professionalV.22-Jul-14 20:13 
QuestionClasses Pin
AnilUppala22-Jul-14 1:52
AnilUppala22-Jul-14 1:52 
AnswerRe: Classes Pin
Ravi Bhavnani22-Jul-14 2:06
professionalRavi Bhavnani22-Jul-14 2:06 
GeneralRe: Classes Pin
AnilUppala22-Jul-14 2:12
AnilUppala22-Jul-14 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.