相关疑难解决方法(0)

如何在Objective-C(iOS)中的图像上写文字?

我想以编程方式制作这样的图像:

例

我有上面的图像和文字.我应该在图像上写文字吗?

我想让它成为一个完整的.png图像(图像+标签)并将其设置为按钮的背景.

iphone uiimageview ios

76
推荐指数
6
解决办法
8万
查看次数

将String文本转换为Bitmap

是否可以将EditText框内的字符串文本转换为位图?换句话说,有没有办法将字符串文本转换为位图,这意味着文本将显示为图像?

以下是我的代码:

class TextToImage extends Activity {

    protected void onCreate(Bundle savedInstanceState) {
        //create String object to be converted to image
        String sampleText = "SAMPLE TEXT";
        String fileName = "Image";

        //create a File Object
        File newFile = new File("./" + fileName + ".jpeg");

        //create the font you wish to use
        Font font = new Font("Tahoma", Font.PLAIN, 11);

        //create the FontRenderContext object which helps us to measure the text
        FontRenderContext frc = new FontRenderContext(null, true, true);
    }
}
Run Code Online (Sandbox Code Playgroud)

android image bitmap

16
推荐指数
3
解决办法
4万
查看次数

如何使用Java加载图像并将文本写入其中?

我的图像位于我的java项目中的images/image.png.我想写一个方法,其签名如下

byte[] mergeImageAndText(String imageFilePath, String text, Point textPosition);

此方法将加载位于图像imageFilePath和在位置textPosition欲写入的图像(左上)的text,那么我想返回表示与文本新的图像合并一个字节[].

java merge text image bytearray

2
推荐指数
2
解决办法
9948
查看次数

标签 统计

image ×2

android ×1

bitmap ×1

bytearray ×1

ios ×1

iphone ×1

java ×1

merge ×1

text ×1

uiimageview ×1