我有两个位图用于imageview,另一个用于GifImageView,我想要做的就是将这两个位图保存到外部存储器。我已将它们保存到外部存储器,但主要问题是GIF无法正常工作。它没有动。有什么帮助吗?
public class LeVisitor<TEntity> : ExpressionVisitor
where TEntity : class
{
private readonly int? _take;
private readonly int? _skip;
private readonly MethodInfo _queryableSkip;
public LeVisitor(int? take, int? skip)
{
// ...
}
protected override Expression VisitMethodCall(MethodCallExpression node)
{
return base.VisitMethodCall(AlterTake(AlterSkip(node)));
}
private MethodCallExpression AlterTake(MethodCallExpression node)
{
if (!_take.HasValue || !node.Method.Name.Equals("Take", StringComparison.Ordinal))
{
return node;
}
Expression innerCall = node.Arguments[0];
if (_skip != null)
{
var innerMethod = innerCall as MethodCallExpression;
if (innerMethod != null && !innerMethod.Method.Name.Equals("Skip", StringComparison.Ordinal))
{
ConstantExpression skipConstant = Expression.Constant(_skip, typeof(int));
innerCall = Expression.Call(_queryableSkip, new[] { innerCall, skipConstant });
}
}
return node.Update(
node.Object,
new[]
{
innerCall,
Expression.Constant(_take, typeof(int))
});
}
private MethodCallExpression AlterSkip(MethodCallExpression node)
{
if (!_skip.HasValue || !node.Method.Name.Equals("Skip", StringComparison.Ordinal))
{
return node;
}
return node.Update(
node.Object,
new[]
{
node.Arguments[0],
Expression.Constant(_skip, typeof(int))
});
}
}
gif是GIFIMAGEVIEW,imgtakenpic是ImageView 提前谢谢。