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

New Post: WriteableBitmap Shift

$
0
0
For a WPF project, I used 3 writeablebitmaps and the Blit method to accomplish something similar in an overridden OnRender method.
  1. First, I crop the original writeablebitmap, "wbm" and make that the source of a new one, "croppedWBM" with the new size and destination (I just move it over by the amount clipped).
  2. Then I create a third, "addWBM" which has the position and size of the new area I want to add.
  3. Finally, I clear the original and use it to Blit "croppedWBM" and "addWBM" together.
This method allows me to be able to write new data to the new section while maintaining the original data (minus the part that was cropped). OnRender is called every second making it appear that the image is moving horizontally, in my case to the left.

Viewing all articles
Browse latest Browse all 360

Trending Articles



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