graphics - .net2.0 vs .net 4.0 gdi+ difference? -
i have weird problem have application lot of involved gdi+ manipulation of pictures. such cropping zooming etc. application works fine in .net 2.0, in .net 4.0 getting reports users crashing gdi+ "out of memory" error. know "out of memory" gdi+ error catch alot of errors, why work in .net 2.0 , not on .net 4.
specifically have control draws "layers" on top of each other in order create composed bitmap. control worked fine in .net 2.0 , not in .net 4.
it secifically happens when have 10 megapixel jpeg loaded file system , applying zoom , transform image.
to give more detail. g.draw matrix scale of 4 meaning 400% bigger rotation return "out of memory error.
it happens on xp boxes , not on windows 7 boxes. difference here?
any takers...
here extent of stack trace logged caught exception.
<event> <timestamp>11/30/10 11:02:43.706</timestamp> <source>appro2</source> <eventtype>error</eventtype> <message><![cdata[##: outofmemoryexception message: out of memory. stack trace: @ system.drawing.graphics.checkerrorstatus(int32 status) @ system.drawing.graphics.drawimage(image image, rectangle destrect, int32 srcx, int32 srcy, int32 srcwidth, int32 srcheight, graphicsunit srcunit, imageattributes imageattrs, drawimageabort callback, intptr callbackdata) @ system.drawing.graphics.drawimage(image image, rectangle destrect, int32 srcx, int32 srcy, int32 srcwidth, int32 srcheight, graphicsunit srcunit, imageattributes imageattr) @ colorvision.graphics.layers.picture.drawbig(graphics g) in d:\colorvision_workspaces\colorvision\graphics\layers\picture.cs:line 321 @ colorvision.graphics.layercollection.drawbig(graphics e) in d:\colorvision_workspaces\colorvision\graphics\layercollection.cs:line 690]]></message> <eventid>0</eventid> </event>
thank time. gentle 1st question here.
0xa3 have no stack trace @ moment, exact g.draw call below:
g.drawimage( bmpbigpicture, new rectangle( destbigx, destbigy, (int)(destbigwidth*scale), (int)(destbigheight*scale)), 0, 0, bmpbigpicture.width, bmpbigpicture.height, graphicsunit.pixel, imgattribs );
where scale 1s 4 400%
i faced similar issues. in case problem loh fragmentation. maybe help: large object heap fragmentation
basically newer know sure how memory allocated. away processing large set of data, app fail. problem more pop if program runs long period of time , processes large amount of data. mentioned 10 megapixels image - if lot of processing such files it's easy hit loh issue.
Comments
Post a Comment