Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: raytracer Pin
leon de boer30-Sep-17 7:50
leon de boer30-Sep-17 7:50 
You are close but you told it there are no clear entries, then write a clear entry and then don't adjust the file header offset.
FileHdr.bfOffBits must point to the offset of the image data as described in the info header.
The easiest solution is drop the whole write clear entry stuff which is not needed and then the offsets are right.

Finally for the OP the structure tagBITMAPFILEHEADER needs to be pack 1.
Look at the first record entry it's a word if that goes normal pack 4 on a compiler the second record will be at offset 4 not offset 2.
In vino veritas

GeneralRe: raytracer Pin
Jochen Arndt30-Sep-17 22:14
professionalJochen Arndt30-Sep-17 22:14 
AnswerRe: raytracer Pin
Rick York29-Sep-17 4:44
mveRick York29-Sep-17 4:44 
GeneralRe: raytracer Pin
leon de boer30-Sep-17 7:39
leon de boer30-Sep-17 7:39 
GeneralRe: raytracer Pin
bluatigro1-Oct-17 0:35
bluatigro1-Oct-17 0:35 
GeneralRe: raytracer Pin
bluatigro1-Oct-17 1:00
bluatigro1-Oct-17 1:00 
GeneralRe: raytracer Pin
leon de boer1-Oct-17 4:45
leon de boer1-Oct-17 4:45 
GeneralRe: raytracer Pin
bluatigro1-Oct-17 5:56
bluatigro1-Oct-17 5:56 
GeneralRe: raytracer Pin
leon de boer1-Oct-17 16:20
leon de boer1-Oct-17 16:20 
GeneralRe: raytracer Pin
bluatigro2-Oct-17 1:34
bluatigro2-Oct-17 1:34 
GeneralRe: raytracer Pin
leon de boer2-Oct-17 3:46
leon de boer2-Oct-17 3:46 
GeneralRe: raytracer Pin
leon de boer2-Oct-17 10:00
leon de boer2-Oct-17 10:00 
GeneralRe: raytracer Pin
bluatigro2-Oct-17 22:57
bluatigro2-Oct-17 22:57 
GeneralRe: raytracer Pin
leon de boer3-Oct-17 4:47
leon de boer3-Oct-17 4:47 
GeneralRe: raytracer Pin
bluatigro6-Oct-17 1:30
bluatigro6-Oct-17 1:30 
GeneralRe: raytracer Pin
bluatigro22-Oct-17 22:37
bluatigro22-Oct-17 22:37 
QuestionCPP Syntax Pin
Bram van Kampen28-Sep-17 11:17
Bram van Kampen28-Sep-17 11:17 
AnswerRe: CPP Syntax Pin
CPallini28-Sep-17 22:16
mveCPallini28-Sep-17 22:16 
GeneralRe: CPP Syntax Pin
Bram van Kampen6-Oct-17 13:51
Bram van Kampen6-Oct-17 13:51 
QuestionComparing Files for Differences Pin
Member 1343302227-Sep-17 3:42
Member 1343302227-Sep-17 3:42 
AnswerRe: Comparing Files for Differences Pin
jeron127-Sep-17 4:09
jeron127-Sep-17 4:09 
QuestionRe: Comparing Files for Differences Pin
David Crow27-Sep-17 5:24
David Crow27-Sep-17 5:24 
AnswerRe: Comparing Files for Differences Pin
jschell27-Sep-17 9:23
jschell27-Sep-17 9:23 
GeneralRe: Comparing Files for Differences Pin
Member 1343302228-Sep-17 2:41
Member 1343302228-Sep-17 2:41 
GeneralRe: Comparing Files for Differences Pin
Jochen Arndt28-Sep-17 3:29
professionalJochen Arndt28-Sep-17 3:29 

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.