如何在Android应用程序中提高位图的图像质量?

时间:2017-04-13 13:45:28

标签: android image bitmap

我需要在Android Studio中提高图像的图像质量。 图像的来源来自PDF文件。

注意:当我放大页面时 - 图像锐化,当我在一个页面中查看整个页面时,它非常模糊。

如何使用?锐化图像质量?我已经阅读了一些关于BitmapFactory的文章,但我不清楚如何实现它。 另外,BitMap工厂是我这样做的最佳方式吗?

我仍然对Android很新,我感觉很好。 任何代码示例和提示都受到了极大的欢迎和赞赏。

注意:我确实使用了互联网上的一个例子,因为我正在教自己如何做到这一点。

以下是我在应用中的代码:

def vertex(x1,x2,x3,y1,y2,y3):
    '''Given three pairs of (x,y) points return the vertex of the
         parabola passing through the points. Vectorized and common expression reduced.'''
    #Define a sequence of sub expressions to reduce redundant flops
    x0 = 1/x2
    x4 = x1 - x2
    x5 = 1/x4
    x6 = x1**2
    x7 = 1/x6
    x8 = x2**2
    x9 = -x7*x8 + 1
    x10 = x0*x1*x5*x9
    x11 = 1/x1
    x12 = x3**2
    x13 = x11*x12
    x14 = 1/(x0*x13 - x0*x3 - x11*x3 + 1)
    x15 = x14*y3
    x16 = x10*x15
    x17 = x0*x5
    x18 = -x13 + x3
    x19 = y2*(x1*x17 + x14*x18*x6*x9/(x4**2*x8))
    x20 = x2*x5
    x21 = x11*x20
    x22 = x14*(-x12*x7 + x18*x21)
    x23 = y1*(-x10*x22 - x21)
    x24 = x16/2 - x19/2 - x23/2
    x25 = -x17*x9 + x7
    x26 = x0*x1*x14*x18*x5
    x27 = 1/(-x15*x25 + y1*(x20*x7 - x22*x25 + x7) + y2*(-x17 + x25*x26))
    x28 = x24*x27
    return x28,x15 + x22*y1 + x24**2*x27 - x26*y2 + x28*(-x16 + x19 + x23)

谢谢!

1 个答案:

答案 0 :(得分:1)

我发现如果更改PDF的原始dpi设置,它会很好地呈现。