bitmap

Multiple Bitmap update on same android SurfaceView

牧云@^-^@ 提交于 2020-01-06 23:42:45
问题 Recently I tried to write an app which captures frame buffer from say USB camera (that need to be displayed as preview), and image processed output that need to be overlapped on the preview. Can anybody give me some pointers how to start? Moreover I need to draw some rectangle on the preview. I was trying to use multiple SurfaceView to draw but not succeeded. Can anybody help me out? 回答1: What you need it the bitmap and image view reference counting. Android keeps image data in native array,

How to update first and second page view in view pager.?

≯℡__Kan透↙ 提交于 2020-01-06 19:49:05
问题 I have View-pager with nine images. I am setting images in view using bitmap. When i choose nine images from gallery first time, its show all nine images perfectly. Also when i choose another nine images from gallery with keep first first or second view same,view-pager display with updated images. But my problem is when I am trying to change all nine images with first and second. they display error like OutOfMemoryEror . so my question is. How to update first and second(next) view in view

Loading an image from resource and converting to bitmap in memory

佐手、 提交于 2020-01-06 19:30:59
问题 I've searched around using google but I'm completely confused on how to load an image (PNG in my case) from resource and then converting it to a bitmap in memory for use in my splash screen. I've read about GDI+ and libpng but I don't really know how to do what I want. Could anyone help? 回答1: GDI+ supports PNG directly. See here and here. EDIT: The GDI+ documentation offers some advice for how to use GDI+ in a DLL. In your case, the best solution is probably to define initialisation and

Loading an image from resource and converting to bitmap in memory

旧时模样 提交于 2020-01-06 19:30:43
问题 I've searched around using google but I'm completely confused on how to load an image (PNG in my case) from resource and then converting it to a bitmap in memory for use in my splash screen. I've read about GDI+ and libpng but I don't really know how to do what I want. Could anyone help? 回答1: GDI+ supports PNG directly. See here and here. EDIT: The GDI+ documentation offers some advice for how to use GDI+ in a DLL. In your case, the best solution is probably to define initialisation and

Forward MouseEvent in transparent bitmap to underlying MovieClip

删除回忆录丶 提交于 2020-01-06 16:52:06
问题 So I'm Bitmaping some heavy stuff to try bring down the [pre-render] and [render] which is quite high according to FlashBuilder's profiling. I thought this was going well until I realised that as soon as you change a MovieClip to a Bitmap, you lose the pixel based accuracy of the mouse move events (Over, Out, Move...), all your left with is the entire bounding box of the Bitmap, something which is less than desirable. I've got a game where many Bitmapped assets would be on top of each other

Forward MouseEvent in transparent bitmap to underlying MovieClip

China☆狼群 提交于 2020-01-06 16:51:56
问题 So I'm Bitmaping some heavy stuff to try bring down the [pre-render] and [render] which is quite high according to FlashBuilder's profiling. I thought this was going well until I realised that as soon as you change a MovieClip to a Bitmap, you lose the pixel based accuracy of the mouse move events (Over, Out, Move...), all your left with is the entire bounding box of the Bitmap, something which is less than desirable. I've got a game where many Bitmapped assets would be on top of each other

卜若的代码笔记-android开发的108个技巧-第10个技巧:View转Bitmap

冷暖自知 提交于 2020-01-06 14:52:14
public Bitmap getViewBitmap(View comBitmap, int width, int height) { Bitmap bitmap = null; if (comBitmap != null) { comBitmap.clearFocus(); comBitmap.setPressed(false); boolean willNotCache = comBitmap.willNotCacheDrawing(); comBitmap.setWillNotCacheDrawing(false); // Reset the drawing cache background color to fully transparent // for the duration of this operation int color = comBitmap.getDrawingCacheBackgroundColor(); comBitmap.setDrawingCacheBackgroundColor(0); float alpha = comBitmap.getAlpha(); comBitmap.setAlpha(1.0f); if (color != 0) { comBitmap.destroyDrawingCache(); } int widthSpec =

Android Bitmap usage Optimization

喜欢而已 提交于 2020-01-06 14:27:37
问题 I've been reading up on different ways to use bitmap each with there own pros and cons. And so I have a question that hasn't really been answered in my search. I have a massive memory leak in my application. So I working through solving the problem, and I use several bitmaps. One Bitmap in particular is used many times by different objects. I call the bitmap image and draw text on it using a Canvas and then compress and save the image in a resolution that suits the device that is using it.

Detecting touch inside a irregular shape in ImageView

二次信任 提交于 2020-01-06 13:12:34
问题 I have an ImageView which has a transparent drawable with a circle at the center like (http://wallpaperswide.com/circle_outline-wallpapers.html). Just that the circle is red, and the surrounding are not coloured but are transparent, it is a .png image. So now I will implement Canvas.ondraw() , and when while tracing the user goes outside the circle, the drawing should restart. The doubt is: 1. How do I detect the boundaries of this image without hardcoding. 2. How do I detect that the user

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

回眸只為那壹抹淺笑 提交于 2020-01-06 10:43:09
问题 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>)