Any way to snap animated TranslateTransform to pixel grid?
Is there any way to snap animated TranslateTransform to pixel grid?
There is a very bad jittering, when moving text using animation. I guess it's because of subpixel positioning. I need to avoid this jit开发者_如何学编程tering. Suggest possible ways.It sounds like you want TextOptions.TextHintingMode="Animated"
in your XAML. See http://msdn.microsoft.com/en-us/library/system.windows.media.textoptions.texthintingmode(v=VS.95).aspx for more details.
Dave Relyea posted an article on how to implement a pixel snapping control in Silverlight. This is a control which listens to the LayoutUpdated event to perform pixel snapping on child elements. Perhaps this is what you're looking for; hopefully without too much modification :)
Why won't you render thit text to WritableBitmap
like this:
WriteableBitmap wb = new WriteableBitmap(textToTranslate, null);
Then place this bitmap into Image
and translate image instead?
What are you trying to do exactly? Do pixel snapping using drag'n'drop? If so, you just could call the method that does the translate if the coordinate is a multiple of a certain number.
A small example of what you are trying to do would also be helpful.
精彩评论