home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
HTPC Projects
Hardware
Ambient Lighting System
AtmoLight - Plugin Improvement discussion
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="BassFan" data-source="post: 1079757"><p>Trotzdem noch was zu meckern.. (Auch wenn Quelltext nicht von dir ist).</p><p> </p><p>Wenn man schon so miesen Quelltext schreibt anstatt über die Struct des BitmapInfoHeader zu gehen so wie es sich eigentlich gehört,</p><p>sollte man zumindest dabei schreiben welche Bedeutung der Offset der jeweiligen Bytes beim BinaryReader (reader.ReadBytes) bedeuten.</p><p>Da blickt ja sonst niemand mehr durch.</p><p> </p><p>[CODE=C#]BinaryReader reader = new BinaryReader(stream);</p><p>stream.Position = 0; // ensure that what start at the beginning of the stream.</p><p>reader.ReadBytes(14); // skip bitmap file info header</p><p>byte[] bmiInfoHeader = reader.ReadBytes(4 + 4 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4);</p><p>byte[] pixelData = reader.ReadBytes((int)(stream.Length - stream.Position)); [/CODE]</p><p> </p><p> </p><p>stream.Length - 0 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite11" alt=":rolleyes:" title="Roll Eyes :rolleyes:" loading="lazy" data-shortname=":rolleyes:" /></p><p> </p><p>gruss</p></blockquote><p></p>
[QUOTE="BassFan, post: 1079757"] Trotzdem noch was zu meckern.. (Auch wenn Quelltext nicht von dir ist). Wenn man schon so miesen Quelltext schreibt anstatt über die Struct des BitmapInfoHeader zu gehen so wie es sich eigentlich gehört, sollte man zumindest dabei schreiben welche Bedeutung der Offset der jeweiligen Bytes beim BinaryReader (reader.ReadBytes) bedeuten. Da blickt ja sonst niemand mehr durch. [CODE=C#]BinaryReader reader = new BinaryReader(stream); stream.Position = 0; // ensure that what start at the beginning of the stream. reader.ReadBytes(14); // skip bitmap file info header byte[] bmiInfoHeader = reader.ReadBytes(4 + 4 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4); byte[] pixelData = reader.ReadBytes((int)(stream.Length - stream.Position)); [/CODE] stream.Length - 0 :rolleyes: gruss [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
Hardware
Ambient Lighting System
AtmoLight - Plugin Improvement discussion
Contact us
RSS
Top
Bottom