[Solved] merge paint results in thread bitmap painting

bitblt(Masterbitmap.Canvas.handle, 0, 0, XPixel, YPixel, bitmap.Canvas.handle, 0, 0, srcand); you explicitly called Masterbitmap.Canvas.Lock, however you didn’t call bitmap.Canvas.Lock (so you can loose the canvas handle anytime within this call…) Additionally, you need to consider thread safety within GDI itself: Sharing of any GDI objects between different threads should be avoided at all cost. For example … Read more

[Solved] Bitmap.createScaledBitmap is not working to resize the image

HI as per my understanding, You can do this and also you can follow This Link Bitmap yourBitmap; Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true); or: resized = Bitmap.createScaledBitmap(yourBitmap,(int)(yourBitmap.getWidth()*0.8), (int)(yourBitmap.getHeight()*0.8), true); Also You can use this method public Bitmap getResizedBitmap(Bitmap bm, int newHeight, int newWidth) { int width = bm.getWidth(); int height = bm.getHeight(); float … Read more

[Solved] Image optimization like whatsapp and instagram in ios and android

Try this code: +(UIImage *)scaleAndRotateImage:(UIImage *)image { int kMaxResolution = 640; // Or whatever CGImageRef imgRef = image.CGImage; CGFloat width = CGImageGetWidth(imgRef); CGFloat height = CGImageGetHeight(imgRef); CGAffineTransform transform = CGAffineTransformIdentity; CGRect bounds = CGRectMake(0, 0, width, height); if (width > kMaxResolution || height > kMaxResolution) { CGFloat ratio = width/height; if (ratio > 1) { … Read more

[Solved] Make uniform colored Bitmap [closed]

in an inefficent way: Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { bitmap.setPixel(i, j, Color.argb(255, 255, 0, 0)); } } for a full red bitmap 1 solved Make uniform colored Bitmap [closed]

[Solved] Can you draw a google static map to a canvas after you download it?

As i mentioned in comments, You could actually reuse the bitmap. You could also draw on canvas directly for date and time since the datetime bitmap will consume 160000 bytes i.e 156kb. I have not tested the code. This is just a suggestion. class TheTask extends AsyncTask<Void, Void, Bitmap> { File mediaFile = new File(MenuScreen.mediaStorageDir.getPath() … Read more