如何使用Magick.NET正确调整图像大小?

时间:2019-05-23 16:47:50

标签: c# magick.net imagemagick.net

我正在使用Magick.NET为Android和iOS的初始屏幕生成一些图像。

但是我在调​​整大小时遇到​​一些问题。

我们可以有一个正方形或长方形的图像以及纵向或横向,但是当我转换时它会拉伸。

            button2.setOnClickListener {
                val intent = Intent(Intent.ACTION_VIEW, Uri.parse("sms:" + "Enter Phone Number"))
                intent.putExtra(
                    "sms_body",
                    "I am in immediate need of assistance, " + " My location is: " + "Latitude: " + lat + " Longitude: " + lon + " Accuracy:  " + acc
                )
                startActivity(intent)
            }
            button6.setOnClickListener {
                val emailIntent = Intent(Intent.ACTION_SENDTO)
                emailIntent.data = Uri.parse("mailto:Enteremailaddress")

                emailIntent.putExtra (Intent.EXTRA_SUBJECT, "Safety Check-in")
                emailIntent.putExtra (Intent.EXTRA_TEXT, "I have reached my destination" + " My location is: " + "Latitude: " + lat + " Longitude: " + lon);
                try {
                    startActivity(emailIntent)
                } catch (e: ActivityNotFoundException) {
                    Toast.makeText(this, "There are no email applications installed.", Toast.LENGTH_SHORT)
                            .show()
                }
            }
            button3.setOnClickListener {
                val emailIntenthelp = Intent(Intent.ACTION_SENDTO)
                emailIntenthelp.data = Uri.parse("mailto:Enter Email")
                emailIntenthelp.putExtra(Intent.EXTRA_SUBJECT, "URGENT ASSISTANCE NEEDED")
                emailIntenthelp.putExtra(Intent.EXTRA_TEXT   , "I am in need of immediate assistance" + " My location is: " + "Latitude: " + lat +  "Longitude: " + lon)
                try {
                    startActivity(emailIntenthelp)
                } catch (e: ActivityNotFoundException) {
                    Toast.makeText(this, "There are no email applications installed.", Toast.LENGTH_SHORT)
                                .show()
                }
            }
        }
    }
}

有人可以帮我吗?这张照片显示了我得到的以及我想要的。

enter image description here

0 个答案:

没有答案