bitmap

GridView Image (from URL) to Second Activity by using Intent

时光怂恿深爱的人放手 提交于 2020-01-06 10:42:24
问题 First of all im giving the codes what i'm using currently MainActivity static final String URL = "http://my .com/images/rss.xml"; static final String KEY_TITLE = "item"; static final String KEY_THUMB_URL = "thumb_url"; // Click event for single list row gridView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, String> map2 = (HashMap<String, String>)

GridView Image (from URL) to Second Activity by using Intent

不想你离开。 提交于 2020-01-06 10:42:04
问题 First of all im giving the codes what i'm using currently MainActivity static final String URL = "http://my .com/images/rss.xml"; static final String KEY_TITLE = "item"; static final String KEY_THUMB_URL = "thumb_url"; // Click event for single list row gridView.setOnItemClickListener(new OnItemClickListener() { @SuppressWarnings("unchecked") @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { HashMap<String, String> map2 = (HashMap<String, String>)

Processing image from a BroadcastReceiver on Android

可紊 提交于 2020-01-06 08:25:12
问题 I´m trying to process an image from a BroadcastReceiver on Android but my log display the following error: call to OpenGL ES API with no current context (logged once per thread). Any ideas. this is my code: public void processingImage(String image){ try { if(image != null){ bmp = convertBitmap(image); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); bitmaps.add(bmp); byteArray = stream.toByteArray(); } } catch (Exception e) { }

Printing a bitmap on a TSC printer

假如想象 提交于 2020-01-06 07:42:23
问题 I try to print image on tsc tdp-225 printer using the android device via OTG. This is example from documentation for printing simple bitmap image on tsc printer . This is my implementation . And this is what the printer has printed Maybe someone has already encountered this problem. Printing a monochromatic bitmap using PUTBMP also does not work. 回答1: fun String.hexStringToByteArray(): ByteArray { val hexStr = this.replace("-", "") var result = ByteArray(hexStr.length / 2, {0}) for(i in 0

android drawing app: line cannot be drawn on a bitmap loaded from gallery

爱⌒轻易说出口 提交于 2020-01-06 07:02:45
问题 I am working on a drawing app, but i do not know why when the picture is loaded from gallery, when further draw on it, the line just drawn will appear on Touch but will disappear when the finger is off the screen, i.e. the line drawn cannot be fixed onto the Bitmap. Would there be anyone that know how to modify it? Many thanks!!! coding: public class DrawView extends View // the main screen that is painted { private static final float TOUCH_TOLERANCE = 10; private Bitmap bitmap; // drawing

android drawing app: line cannot be drawn on a bitmap loaded from gallery

我是研究僧i 提交于 2020-01-06 07:02:44
问题 I am working on a drawing app, but i do not know why when the picture is loaded from gallery, when further draw on it, the line just drawn will appear on Touch but will disappear when the finger is off the screen, i.e. the line drawn cannot be fixed onto the Bitmap. Would there be anyone that know how to modify it? Many thanks!!! coding: public class DrawView extends View // the main screen that is painted { private static final float TOUCH_TOLERANCE = 10; private Bitmap bitmap; // drawing

How to remove bitmap image on click from canvas

陌路散爱 提交于 2020-01-06 06:18:09
问题 I am using createjs as my framework. I've placed a Bitmap on the canvas and I created a function to try and remove it but I keep getting an error message in the console that image is not defined. This is what my code looks like: // onload=init() called in html doc function init(){ var canvas = new createjs.Stage("canvas"); // Add image to canvas image = new createjs.Bitmap("image.png"); image.x = 200; image.y = 180; image.scaleX = 0.35; image.scaleY = 0.35; canvas.addChild(image); image

Paste the contents of a Bitmap into a PictureBox

旧巷老猫 提交于 2020-01-06 04:37:47
问题 I'm currently writing a little paint application where the user is able to draw on a Panel. I am working on the select tool and want to be able to select a certain area of the Panel, and then paste this selected area directly into a PictureBox that I have just to the right of the Panel. My problem is that my code at the moment is not working correctly, when I try to paste the Bitmap that I am creating from the panel I am getting a big red X in the PictureBox instead of the actual image. I

Drawing fast in canvas Bitmap android ics

谁都会走 提交于 2020-01-06 04:30:20
问题 I've been developing an app to draw in ics android tablets and i've encountered an issue I can't figure out how to fix. The problem is that I draw correctly and in a real time drawing BUT when I go really really fast (tested on real tablets) the circles are not really circles, they look like pilygons of 5 or 6 sides... Here I declare the bitmap and assign it to the canvas: Display display = getWindowManager().getDefaultDisplay(); Point size = new Point(); display.getSize(size); width = size.x

Computing a UIImage to be saved to the photo album

风流意气都作罢 提交于 2020-01-06 02:39:04
问题 I basically want to automatically create a tiled image from a bunch of source images, and then save that to the user's photo album. I'm not having any success drawing a bunch of small UIImage's into one big UIImage. What's the best way to accomplish this? Currently I'm using UIGraphicsBeginImageContext() and [UIImage drawAtPoint], etc. All I ever end up with is a 512x512 black square. How should I be doing this? I'm looking to CGLayer's, etc. seems there are a lot of options but none that