如何配置默认的url服务器进行滑行?

时间:2019-04-26 14:29:45

标签: android android-glide

我有这个网址服务器:

for (int y = 0; y < frame.rows; y++)
{
    for (int x = 0; x < frame.cols; x++)
    {
        const Point2f fxy = fflow.at<Point2f>(y, x);
        fy = CLAMP(y - fxy.y*0.5, 0, frame.rows);
        fx = CLAMP(x - fxy.x*0.5, 0, frame.cols);
        flowf.at<Vec3b>(y, x) = prevframe.at<Vec3b>(fy, fx);

        const Point2f bxy = bflow.at<Point2f>(y, x);
        by = CLAMP(y - bxy.y*(1 - 0.5), 0, frame.rows);
        bx = CLAMP(x - bxy.x*(1 - 0.5), 0, frame.cols);
        flowb.at<Vec3b>(y, x) = frame.at<Vec3b>(by, bx);
    }
}

我想默认将"http://10.0.2.2:5000/image/img_lights.jpg" 放在我的GlideModule中。

所以当我叫滑行时,我只需要传递“ /image/img_lights.jpg”

"http://10.0.2.2:5000"

我必须在模块中添加什么?

Glide.with(this).load("/image/img_lights.jpg").into(imageViewProfile);

1 个答案:

答案 0 :(得分:0)

创建一个AppConstant类并在您的类中设置一个变量:-

public static final String IMG_BASE_URL = "http://10.0.2.2:5000/";

并在项目中所需的位置调用变量:-

Glide.with(this).load(AppConstant.IMG_BASE_URL+"/image/img_lights.jpg").into(imageViewProfile);