Quantcast
Channel: WriteableBitmapEx
Viewing all articles
Browse latest Browse all 360

Created Unassigned: DrawRectangle clipping and pixbuffer check [22244]

$
0
0
__DrawRectangle__ misbehaves with respect to the following issues
* it is easily possible to get WriteableBitmap with Width, Height not matching pixel buffer. For example when loading a bitmap from stream one has first to specify its size which can differ from that stored in the stream. Performing pixel operation in such case causes AccessViolation
* for x, y coordinates < 0 they are set to 0 which causes an unwanted edge to be drawn
* the same is true for coordinates exceeding the other bounds, the edges are adjusted and painted which may not be the expected behavior

Attached you can find an implementation of __DrawRectangleClip__ which behaves correct with respect to the points mentioned above. You may as well replace the erroneous implementation with this one.

Regards
Miroslaw

Viewing all articles
Browse latest Browse all 360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>