mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Fixed hard coded Encoder, if sometime the encoder order changes this would have broken the code. Also removed a stream wrapper.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2130 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
b600d72156
commit
5714b59a14
2 changed files with 16 additions and 9 deletions
|
@ -256,11 +256,9 @@ namespace GreenshotPlugin.Core {
|
|||
int iImageSize = BitConverter.ToInt32(srcBuf, SizeICONDIR + SizeICONDIRENTRY * iIndex + 8);
|
||||
int iImageOffset = BitConverter.ToInt32(srcBuf, SizeICONDIR + SizeICONDIRENTRY * iIndex + 12);
|
||||
using (MemoryStream destStream = new MemoryStream()) {
|
||||
using (BinaryWriter writer = new BinaryWriter(destStream)) {
|
||||
writer.Write(srcBuf, iImageOffset, iImageSize);
|
||||
destStream.Seek(0, System.IO.SeekOrigin.Begin);
|
||||
bmpPngExtracted = new Bitmap(destStream); // This is PNG! :)
|
||||
}
|
||||
destStream.Write(srcBuf, iImageOffset, iImageSize);
|
||||
destStream.Seek(0, System.IO.SeekOrigin.Begin);
|
||||
bmpPngExtracted = new Bitmap(destStream); // This is PNG! :)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue