dynamic-image-generation

Android: Best Way to Programmatically Make an Image and Save it to a Bitmap?

断了今生、忘了曾经 提交于 2020-01-06 05:34:08
问题 I have an app that connects to an external printer device and I need to take some user data and dynamically make an image and print it. The printer API requires a bitmap as input for printing. Note that I never want to draw the programmatically created image to the screen; the generation and printing of the image have no visible UI, it happens in the background. So far I've considered doing it one of the following ways: 1) Make a canvas, never call the draw functions, translate it to a bitmap

Generate an image from arbitrary strings

倖福魔咒の 提交于 2019-12-19 04:45:08
问题 I've seen plenty of image to ascii art converters, but what I need is a little more complex. Instead of a mosaic image created from ascii chars I need to be able to use a predefined set of strings of arbitrary lengths as my mosaic tiles. I've done a good bit of Googling, but Im not even sure how to structure my query? Does anything like this exist? And bonus if it wont use duplicates in its image generation. 回答1: Not really suitable for Stack Overflow, but an interesting project nevertheless.

imagettftext(): calculate font size to ensure text fits image width

扶醉桌前 提交于 2019-12-17 19:54:21
问题 I'm using imagettftext() to write dynamic text on an image and I want it to fit my image width. How can I calculate the font size by the text lenght? 回答1: You can calculate the bounding box of TTF text before outputting it with the imagettfbbox function. Unfortunately there is no direct way of scaling to fit a width, so you'll have to do it yourself. One way of doing it is to pass the text with a default font size of, say 20, to imagettfbbox and retrieve the width from it. You can then

Is there anyway to make one image out of 3 image URLs using asp.net mvc?

不打扰是莪最后的温柔 提交于 2019-12-14 03:45:36
问题 I would like to build a facebook application similar to nametest or Meaww and almost succeeded to have my API calls to Facebook Graph API and return data from facebook. What makes me confused is the UI of aforementioned web applications. When you complete a test on Meaww or Nametests the result is represented to the user is in Image (Jpeg) format. I just don't know how they manage to convert HTML to an Image on the fly with all CSS styling and etc and how they return it back to the user as an

PHP Using imagegrabscreen

这一生的挚爱 提交于 2019-12-11 04:35:38
问题 How could I use imagegrabscreen to get a thumbnail image and a full size image of a specific website. I was thinking that I could have an array that I feed the wanted uri's into but I am a bit stuck on how I would set the wxh of the image I need to grab. I also think that I would need a thumbnail class and a fullimage class and call them when required. Any better Ideas? 回答1: Keep in mind that imagaegrabscreen is Windows-only. If you have multiple displays set up, this function will only grab

Live Thumbnails/Large Image

℡╲_俬逩灬. 提交于 2019-12-02 19:27:34
问题 Is there any way to get a certain thumbnail generated by PHP from a live given URI? I also would want to do this for the live on click image. 回答1: Form what i understand you want to generate thumbnail of a given website via its URL ??? If that is what you want then Website screenshots using PHP would help you I prefer the Pure PHP option if you are using a windows server but if not then you would have to use 3rd party APU like http://www.thumbalizr.com/apitools.php Another method is using

Live Thumbnails/Large Image

依然范特西╮ 提交于 2019-12-02 13:38:36
Is there any way to get a certain thumbnail generated by PHP from a live given URI? I also would want to do this for the live on click image. Baba Form what i understand you want to generate thumbnail of a given website via its URL ??? If that is what you want then Website screenshots using PHP would help you I prefer the Pure PHP option if you are using a windows server but if not then you would have to use 3rd party APU like http://www.thumbalizr.com/apitools.php Another method is using HTML5 Canvas or Converting the site to PDF -> PNG or any image format I hope this information helps Thanks

Dynamically create image from JAX-RS servlet

末鹿安然 提交于 2019-12-01 06:34:04
Is it possible to create a PNG image and output it straight to the browser as part of a JAX-RS resource? Something like this: @Path("img/{externalId}") @Stateless @Produces({"image/png"}) public class MyImgResource { @GET public Response (@PathParam("externalId") String externalId) { // create image, write to buffered output stream return Response.ok().entity(stream).build(); } } Would this work? Do I have to take care of the correct headers (Content-Type), or is this done by the @Produces annotation? Can output an image as a Response ? Can I build a Response from a stream? Take a look at http

Dynamically create image from JAX-RS servlet

六月ゝ 毕业季﹏ 提交于 2019-12-01 04:50:31
问题 Is it possible to create a PNG image and output it straight to the browser as part of a JAX-RS resource? Something like this: @Path("img/{externalId}") @Stateless @Produces({"image/png"}) public class MyImgResource { @GET public Response (@PathParam("externalId") String externalId) { // create image, write to buffered output stream return Response.ok().entity(stream).build(); } } Would this work? Do I have to take care of the correct headers (Content-Type), or is this done by the @Produces

Generate an image from arbitrary strings

浪尽此生 提交于 2019-12-01 01:25:52
I've seen plenty of image to ascii art converters, but what I need is a little more complex. Instead of a mosaic image created from ascii chars I need to be able to use a predefined set of strings of arbitrary lengths as my mosaic tiles. I've done a good bit of Googling, but Im not even sure how to structure my query? Does anything like this exist? And bonus if it wont use duplicates in its image generation. Not really suitable for Stack Overflow, but an interesting project nevertheless. So I had a go at it for a bit of fun and see how far I could get. I think it comes down to this: calculate