如何在地图上的android系统中的另一个图像显示的图像?图像、在地、图上、系统

2023-09-08 08:45:16 作者:服软

我想在地图上的另一个图像显示的图像。

喜欢

下面红色的图像是不同的图像,黑的偶像形象的是不同的。

解决方案

 公共位图mergeBitmaps(位图manBitmap){

    尝试{
        位图markerBitmap = BitmapFactory.de codeResource(this.getResources(),R.drawable.red_box_image);
        位图bmOverlay = Bitmap.createBitmap(markerBitmap.getWidth(),markerBitmap.getHeight(),markerBitmap.getConfig());
        帆布油画=新的Canvas(bmOverlay);
        canvas.drawBitmap(markerBitmap,新的Matrix(),NULL);
        canvas.drawBitmap(manBitmap,5,5,NULL);
        返回bmOverlay;
    }
    赶上(例外前){
        ex.printStackTrace();
        返回null;
    }
 

基于Android的车载导航系统的研究与设计

I want to show image within another image on map.

like

Here red colored image is different Image and the black idol image one is different .

解决方案

  public Bitmap mergeBitmaps(Bitmap manBitmap){

    try{
        Bitmap markerBitmap = BitmapFactory.decodeResource( this.getResources(), R.drawable.red_box_image);
        Bitmap bmOverlay = Bitmap.createBitmap(markerBitmap.getWidth(), markerBitmap.getHeight(), markerBitmap.getConfig());
        Canvas canvas = new Canvas(bmOverlay);
        canvas.drawBitmap(markerBitmap, new Matrix(), null);
        canvas.drawBitmap(manBitmap, 5, 5, null);
        return bmOverlay;
    }
    catch(Exception ex){
        ex.printStackTrace();
        return null;
    }