FAQ Database Discussion Community


Paste pivot table as bitmap into Body of Outlook Appointment

excel-vba,bitmap,outlook,paste,appointment
Using Excel VBA, I'd like to make a small pivot table visible to Outlook users. I do NOT want to paste into a message body I DO want to paste into an appointmentItem Here is my code that creates the Appointment and copies Range to clipboard. How do I paste...

c# Bitmap is already locked screenshots

c#,sockets,bitmap,screenshot
im trying to make a program that takes screen shots and compare them. this is a sample of the code compare method: [DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)] static extern int memcmp(IntPtr b1, IntPtr b2, UIntPtr count); public bool CompareMemCmp(Bitmap b1, Bitmap b2) { if ((b1 == null) != (b2== null)) return...

Clear Bitmap in Android

android,bitmap,xamarin
I create first chart using bitmap and canvas. How I can clear bitmap for drawing new chart? ImageView imageView = new ImageView(this); Bitmap bitmap = Bitmap.CreateBitmap(w, h, Bitmap.Config.Argb8888); Canvas canvas = new Canvas(bitmap); ... imageView.SetImageBitmap(bitmap); relativeLayout.AddView(imageView); ...

canvas drawBitmap only part of image

android,android-layout,bitmap
How do I draw a part of a bitmap using canvas with canvas.drawBitmap() ? For example I have the following bitmap And I need to draw only this part Is it possible to do with canvas.drawBitmap or I need something else?...

How to read a bitmap from the Windows Clipboard

c++,windows,bitmap,sfml
I am writing an extremely small C++ program to help me animate sprites. I'd like it to take data I copy to the clipboard from photoshop, manipulate it in my program, then overwrite the clipboard with the transform. The problem though is that I'm not sure how to read the...

Java variable scope - copying bitmaps?

java,bitmap,scope,recycle
I'm trying to better understand how Java variable scope works and what exactly happens to the underlying data when we do something like the following in a method: this.variable = variable What exactly does this line do? Here is my actual problem: I'm loading Bitmaps to apply as textures in...

How to overlay bitmap over another bitmap at particular XY position

android,bitmap,android-canvas
I am working on a project where I have used canvas and user can touch move one bitmap overlay to another bitmap. When user presses save button then both bitmaps should merge and become a single bitmap. I have done all things and now merging two bitmap at XY position...

Android: How to write a Bitmap to internal storage

java,android,bitmap,save,storage
I am making an app that gets images from a URL. I want to be able to store these images on the phone so that if the url is the same as before, the user won't have to wait for the image to load but instead the app will pull...

Rounded Corner doesn't work on openFileInput Bitmap

android,bitmap
The Rounded Corner code works on both Volley NetworkImageView and the resource. But it doesn't work on the Bitmap from ApplicationContext. Here below is the code. public class ImageViewUtils { public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int pixels) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final...

Android video thumbnail is null

android,bitmap,thumbnails,video-thumbnails
So basically what I'm trying to achieve is that the user can choose to select an existing video or take a new one, but my bitmap has always a null value. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_VIDEO_CAPTURE && resultCode == RESULT_OK ||...

C# Memory Leak on on different machines

c#,memory-leaks,bitmap,garbage-collection
Background info I've developed a desktop application with Windows Form (C#) for scanning, previewing and saving images. The app behaviour while scanning is the following: Scan n images Get a Bitmap for each image and store it in a temporary file Show resized thumbnails as a preview Image memory management:...

Bitmaps not scaling correctly AS3

actionscript-3,flash,bitmap,bitmapimage
I was experimenting with bitmaps and created an alpha mask. When i test the program in full screen, it works fine however when I re-size the screen, the bitmap alpha masks doesn't seem to scale correctly. Below are illustrations of my issue. The bitmap alpha mask is shown as a...

How to get Bit Depth of a Bitmap on Mono For Android

bitmap,monodroid,android-bitmap
In .NET one way to check the bitdepth of a Bitmap image is using the Bitmap class like so: switch (bitmap.PixelFormat) { case System.Drawing.Imaging.PixelFormat.Format1bppIndexed: return 1; case System.Drawing.Imaging.PixelFormat.Format4bppIndexed: return 4; case System.Drawing.Imaging.PixelFormat.Format8bppIndexed: return 8; case System.Drawing.Imaging.PixelFormat.Format16bppArgb1555: case System.Drawing.Imaging.PixelFormat.Format16bppGrayScale: case System.Drawing.Imaging.PixelFormat.Format16bppRgb555: case...

How to display very long Bitmaps in Android?

android,image,bitmap
Suppose you have an image that measures 500x6000 pixels. I tried loading such an image in my Android app but soon found out that there are maximum dimensions for bitmaps (as described here) Now, I still would like to be able to show such an image. How can I do...

How to know the scale for a bitmap in Delphi XE8?

delphi,bitmap,scale,firemonkey,delphi-xe8
I have an image component for drawing an autograph. At the moment you have to set a scale property mannually in order to let it draw correctly, because each device has an other screen density. Is there a way to calculate the scale or not to have to use the...

How to get raw string of an image from Bitmap in android?

java,android,image-processing,bitmap
I am making an app where people can take and upload photos. I currently have a Bitmap object that represents the photo, and I'd like to post this to a server. Unfortunately, the server expects raw text of the jpg (like what you would see if you typed cat /path/to/jpg...

Create bitmap from two imageView with exact location

android,android-layout,bitmap
My Target: Get one photo from camera or gallery, then set it to imageViewA Add a draggable mask imageViewB on top of imageViewA Users drag the mask imageViewB to anywhere in imageViewA Users then click the save button A combined bitmap of imageViewA and imageViewB should be created My Problem:...

How to make a background image fill the canvas?

android,canvas,bitmap,background
Hello everyone I am new to android and I just have a quick question. I am making an animation using Bitmaps and drawing them to the canvas using the onDraw(). I am trying to draw a background to the canvas that I made in photoshop. I already uploaded it as...

Set Bitmap as cover art for MP3

c#,bitmap,taglib-sharp
I have been trying to set a bitmap as cover art for a MP3 but I can't seem to get it working. It isn't throwing any errors but when I play the MP3 the bitmap isn't showing. This is what I currently have: TagLib.File f = TagLib.File.Create("song.mp3"); Image currentImage =...

What's wrong with this inSampleSize calculating method for Bitmaps? Out of memory

java,android,bitmap
In my app i'm iterating through URLs of images, decoding and putting them in an ArrayList<Bitmap>. They may vary greatly in size, so i'm doing a "pre-decode" with the inJustDecodeBounds = true option to calculate the necessary inSampleSize value for the actual decode. See my method for this below, i...

CV_32FC1 to bitmap

c++,winforms,opencv,bitmap
I've an image loaded in a Mat. From this, I calculate the DFT, so in a new Mat I've the DFT stored (both the real and img. parts). Since here, I aim to draw the magnitude of the DFT. I've achieved this already with OpenCV, by calculating it, take it...

out of memory Error Unsolved

android,bitmap
I am taking the image from internal memory.and pasting it on the greator image in the merge function.after the 66 image the app is crashing badly and the error is out of memory . Do you have any idea why the app crashing and how to solve it.here the app...

How to convert any image to bitmap image and store in MySQL database using PHP?

php,mysql,bitmap,upload
How to convert any image to bitmap image and store in MySQL database using PHP? I want to store an image in a database. How to convert any images to bitmap image. <?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if...

Converting Text view to bitmap returns null

java,android,canvas,bitmap,textview
I am trying to make an image of dynamically added views in my activity. Can you please tell me what I am doing wrong, the bitmap returns null for some reason. Thanks, protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_share); TextView tv = new TextView(this); tv.setText("sadasdsadssad"); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(...

Draw text on canvas dont work with mutable bitmap

android,google-maps,canvas,bitmap,mutable
I want to use custom markers on google maps in my Android app. For this I have a method, which creates me Bitmaps. Each Bitmap is a marker including special text on it. I have done this and it works ok on my 2.3.3 Android. But on other devices it...

Creating bitmap from string path

android,performance,time,bitmap
So i'm creating bitmap, using this code: BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; options.inMutable = true; return BitmapFactory.decodeFile(photoPath, options); My problem is, why is it taking so much time creating it on some mobile ? is there any way to create bitmap without wasting a lot of time...

Android BitmapDecode in listview

android,string,listview,bitmap
I use the folowing to get a bitmap from my device and display it in a listview pic1="Harris1.jpg" pic2="Harris2.jpg" pic3="Harris3.jpg" Bitmap bmp = BitmapFactory.decodeFile("/storage/emulated/0/Pictures/" + pic1); Bitmap bmp1 = BitmapFactory.decodeFile("/storage/emulated/0/Pictures/" + pic2); Bitmap bmp2 = BitmapFactory.decodeFile("/storage/emulated/0/Pictures/" + pic3); Bitmap[] image={bmp,bmp1,bmp2}; for(int i=0;i<text1.length;i++) { item_details.setImage(image[i]); } this works fine but is...

One Large Bitmap vs. Many Small Bitmaps

android,memory,bitmap
I'm making a card game for android and need to load in bitmaps for the entire deck of cards. Would it be more memory efficient to create a separate image for each card and load them in one by one, or to create one large image with all 52 cards...

Android Bitmap - What is nativeBitmap?

android,bitmap,native
So I was looking in the source code of the bitmap class and I saw this: public final long mNativeBitmap; What is the native bitmap long? It surely can't be the actual bitmap because a long is 64-bit (8 bytes) which can't handle a bitmap bigger than 2 pixels (supposing...

I need to know what the highest and lowest pixel between two images in WPF with C#

c#,wpf,bitmap,pixel
I have the pixels of each image stored in the Col1 and Col2. How can I know which is the highest pixel and put in a third image? My definition of highest pixel is as the "por mayor" result in this video: https://www.youtube.com/watch?v=l1_WmoiKgPg I would also like to know how...

Snapshot of a Xamarin.Forms.View

android,bitmap,xamarin,monotouch,xamarin.forms
I am making an application using Xamarin.Forms, and I need to make a snapshot of a view (including parts not currently visible). I know full well how to do this on android, but I haven't found any clues on how to do this with Xamarin.Forms.View Is there a way to...

Can you draw multiple Bitmaps on a single View Method?

android,canvas,bitmap,android-animation
currently I am trying to make an animation where some fish move around. I have successfully add one fish and made it animate using canvas and Bitmap. But currently I am trying to add a background that I made in Photoshop and whenever I add it in as a bitmap...

Android CardView setBackground as BitmapDrawable when API <21

android,bitmap,recyclerview
I have a problem when I am trying to setBackground() of a CardView programatically in KitKat.When the application is running on Android L there is no problem in my code : Drawable drawable = new BitmapDrawable(appContext.getResources(), bitmap); if (cardView != null) { cardView.setBackground(drawable); } But when it runs in API...

Out of memory exception occurred at Bitmap Shadder android

android,bitmap,bitmapshader
I am working on android application in which i am using Bitmap, but the problem is that sometimes it shows me an error of out of memory and my application get crashed. I am using bitmaps along with BitmapShadder, my code is given below where my application shows this error....

Android edit images on the fly

android,opencv,bitmap,android-bitmap,opencv4android
It seems that in Android there are no "easy" libraries for editing and save pictures, neither free or with licenses). Aviary is no longer available. I have to implement an app for Taking picture, edite with some effects on the fly (Vignetting contrast, brightness...), add some text and save. A...

Android load image into imageview efficiently

android,bitmap,imageview,out-of-memory
I have next problem: To avoid OutOfMemoryError i'm loading my big images into ImageViews using Picasso in such way: public static RequestCreator picasso(final Context context, final int resourceId) { return Picasso.with(context) .load(resourceId) .fit() .centerCrop() .noFade(); } And in activity or fragment, i'm loading image into ImageView final ImageView backgroundImage =...

Android : How to set image with url by a subroutine

android,url,bitmap
I'm creating a subroutine to get an image using a url. Here is a similar subroutine that I used to parse text from an XML into my UI: public void loading(int index) { final Handler handler = new Handler(); new Thread(new Runnable() { @Override public void run() { try {...

Loading Bitmap to ImageView from URL in android

android,url,bitmap,bitmapfactory
I am using following method to retrieve a bitmap from the url and pass it on to the imageview , but the imageview is not being updated. public static Bitmap LoadImageFromWebOperations(String url) { Bitmap bitmap; try { InputStream is = new URL(url).openStream(); bitmap = BitmapFactory.decodeStream(is); return bitmap; } catch (Exception...

Generate bitmap from view

android,bitmap,android-annotations
When I get the bitmap from the DrawingCache of a view I get no error but I don't see a valid bitmap either. What am I doing wrong? The code I use to generate the bitmap: SharePhotoView sharePhotoView = SharePhotoView_.build(this); sharePhotoView.bind(mCatch); sharePhotoView.setDrawingCacheEnabled(true); sharePhotoView.buildDrawingCache(); Bitmap bitmap = sharePhotoView.getDrawingCache(); catchImage.setImageBitmap(bitmap); The code...

Android How can I using Cursor get image and video thumbnails in my direct path both?

java,android,bitmap,cursor
How can I using Cursor get image and video thumbnails in my direct path in same cursor? I need get the image and video thumbnails in /DCIM/100ANDRO folder. But I just can separate to get image and video in at sd card all data. private ArrayList<ImageItem> getData() { final ArrayList<ImageItem>...

android Bitmap Subsampling of Image

android,listview,bitmap,subsampling
Im having problems with out of memory errors when displaying images in a listview from the SD Card I know its because I need to subsample the bitmap as they are large 8mp pictures and if I shrink them to 600 x 450 they load perfectly I load them normally...

Android Facebook version 4.0 open graph post bitmap failing

android,facebook,facebook-graph-api,bitmap
I have the code below attempting to post an Open Graph story with attached bitmap image. The Bitmap is about 1 Meg in size so is within the Facebook limitation. The Share Dialog is displayed and the post will work but with no image showing! I do have appropriate provider...

take screenshot from layout and share via android

android,android-intent,bitmap
I use below code to take screen shot from my layout and share it via android intent but the captured screen shot in the selected app is not showing any thing. @Override public void onClick(View view) { shareBitmap(this,takeScreenshot()); } public Bitmap takeScreenshot() { try{ View rootView = getWindow().getDecorView().findViewById(R.id.lyt_main_report_activity); rootView.setDrawingCacheEnabled(true); return...

Changing bitmap image on loop

java,android,bitmap
I have a canvas and I wish to change the bitmap image every 50 milliseconds. Basically what I'm trying to do is like a gif animation. As you can see there's 4 images and every 50 milliseconds I want it to change the image. the code below doesn't work and...

Android: Can we create bitmaps with Strings on it on the application runtime?

android,bitmap,android-bitmap,android-runtime
I want to create a Bitmap with some string data on it, and later send it to my mobile printer. How can we do that?...

Why I am unable to set ImageBitmap to RelativeLayout here?

android,android-activity,bitmap,background
I'm trying to select a background image from gallery and set it as Activity background. But the problem is here when I set RelativeLayout instead of ImageView, it gives me error on setImageBitmap, what;s the reason here? Here's my code: I referred to this tutorial : http://viralpatel.net/blogs/pick-image-from-galary-android-app/ Thanks in advance!...

Convert raw image from JAI GigE camera to bitmap in C#

c#,bitmap,camera,aforge,gige-sdk
I'm using a JAI GigE Vision camera for image acquisition, but I want to use the AForge Library in C# for the image analysis to create a camera independent solution. Jai_FactoryWrapper.ImageInfo localImageInfo = new Jai_FactoryWrapper.ImageInfo(); image = (Bitmap)localImageInfo; But it gives back an error: Cannot convert type 'Jai_FactoryDotNET.Jai_FactoryWrapper.ImageInfo' to 'System.Drawing.Bitmap'...

Upload a picture taken by the camera to a server with limited size

android,bitmap,android-photos
the title sounds maybe a bit like a "noob question" but I know quite well how to program for Android, I just to figure out what it is the best way to achieve what I want. My use case is: the user takes a photo and sends it to our...

How to convert an Image to Mat Android

android,image,bitmap,mat
I need to process Image for my Application. I get the Images for ImageReader. reader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReader reader) { Image mImage = reader.acquireNextImage(); //mImage to Mat here mImage.close(); } },null); But now, I need to convert those images in Mat. I know that I can pass...

Errors in bitmap creation in Java

java,bitmap,drawing,bmp
I'm trying to create a bitmap from a 2d array of pixel values. I've found some code on the internet (taken from http://forum.codecall.net/topic/62457-creating-a-bmp-image-in-java/): import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class BMP { private final static int BMP_CODE = 19778; byte [] bytes; public void saveBMP(String filename, int...

winapi: from HDC to an HBITMAP

c++,winapi,bitmap,gdi
I would like to do something which I believe is fairly simple but since I am new to the winapi I am finding a lot of problems. Basically I have an HDC (which I am BitBlitting from a loaded Bitmap) and I am drawing a rectangle on it. Then I...

Bitmap not circle properly

android,bitmap,imageview
i trying to do bitmap circle it work but high resolution image not work properly.It is working like small circle in image view. i have tried this code and i tried many other code,but didn't work properly public static Bitmap circleShape(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas...

Convert immutable Bitmap file to mutable Bitmap

android,bitmap,immutability,mutable
A: Bitmap immutableBmp= BitmapFactory.decodeResource(getApplicationContext().getResources(),R.drawable.sample); mutableBitmap=immutableBmp.copy(Bitmap.Config.ARGB_8888, true); B: Bitmap immutableBmp= BitmapFactory.decodeFile(filePath); mutableBitmap=immutableBmp.copy(Bitmap.Config.ARGB_8888, true); C: BitmapFactory.Options options = new BitmapFactory.Options(); options.inMutable=true; myBitmap=BitmapFactory.decodeFile(filePath,options); A works but B and C don't. I am trying to convert a immutable bitmap to mutable. It works on...

Should I compress a Bitmap before POSTing it to a server?

android,post,bitmap,multipart
I have a question regarding best practices for this. If I am doing a multi part request to a server, should I compress the .jpg file (assuming the .jpg file is large) I would be POSTing to the API on the client (Android) side? Or is this usually not a...

android BitmapFactory.decodeStream low quality

android,bitmap
I'm trying to decode an inputstream to bitmap, the code is so simple : Bitmap myBitmap = BitmapFactory.decodeStream(myStream); BUT the quality of outputed bitmap is too low (sometimes, and sometimes the quality is good). also the source has a good quality image. i tried to play with Bitmap options but...

What is the word for colorizing grayscale bitmap

algorithm,graphics,colors,bitmap
I have a task of converting grayscale (8 bit, 256 levels of gray) bitmap to a colored one, with the function that looks somewhat like this: function colorize(bmp, colorA, colorB) In the end black pixels become colorA, and black pixels become colorB, and grayscale pixels a mix of A and...

Android - Drawing lines using bitmap on TouchImageView

android,bitmap
Basically I would like to draw lines on an image so that when that image is zoomed, the lines would also get zoomed proportionally, or any kind of interactivity like fling or zoom reset. I'm using TouchImageView as my ImageView and here's my code public class ParkA extends Activity{ @Override...

NullPointerException when calling Bitmap.createBitmap

android,bitmap,nullpointerexception
I'm trying to get a bitmap drawn from a view, as I want to blur that bitmap and use it as a background for a following activity. Logcat gives me: NullPointerException at android.graphics.Bitmap.createBitmap(Bitmap.java:484) My code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the view from activity_main.xml setContentView(R.layout.activity_splash_page); ProgressWheel...

Converting image url to bitmap quickly

android,bitmap,imageview,imageurl,imagehandler
I need to display the list of images from api in the list page. For that i used two approaches. First Approach: By converting the url to byte array and then converting it into bitmap.Please find the below code.. URL imageUrl = new URL(url); URLConnection ucon = imageUrl.openConnection(); InputStream is...

How to release an object created from GdipCreateBitmapFromHBITMAP?

c,winapi,bitmap,gdi+
I'm writing a C application and in my code I'm calling the constructor GdipCreateBitmapFromHBITMAP. I know the constructor should not be called from C, but I used a "hack" from here "How can I take a screenshot and save it as JPEG on Windows?" I'm not sure how to release...

How to display images from ObservableCollection in mvvm

c#,wpf,xaml,mvvm,bitmap
I'm still tyring to get my head around MVVM. I got stuck on displaying my images which paths are stored in an observableCollection. In the past I could make it would with code behind in the view but now when I'm trying to implement MVVM on my project and it...

webview not generating completely as bitmap in lollipop android

android,webview,bitmap
I want to generate bitmap from webview full page. some codes Below code for generating Bitmap from webview Webview to Bitmap : Picture p = webview.capturePicture(); webview.setDrawingCacheEnabled(true); webview.buildDrawingCache(); final PictureDrawable pictureDrawable = new PictureDrawable(pict); Bitmap bitmap = null; try { bitmap = Bitmap.createBitmap(pictureDrawable.getIntrinsicWidth(),pictureDrawable.getIntrinsicHeight(), Config.ARGB_8888); } catch (OutOfMemoryError e) { e.printStackTrace();...

How to Calculate bfOffBits

c,bitmap,byte
I'm attempting to read and open a BMP file manually with C, and after reading the BMP specs and learning about how these files work, the header has definitions for the bytes that equal things like bfOffBits and biWidth. So for example the bfOffBits is equal to 4 bytes which...

Takes 25+ Seconds To Save Bitmap From Camera To Phone

java,android,bitmap,camera,bytearray
I am making a camera app. There has been a host of issues getting orientation right because some phones don't write EXIF orientation data. Because of this, I get the bitmap, save it (since I don't think I should read EXIF data from the byte[]), then rotate the bitmap, then...

How to load array bitmap display in View Pager?

android,bitmap
I have array of bitmap in my Activity. I want to load that array bitmap in to ViewPager. I don't have nay idea for this concept.

Android: Get Bitmap from a 2D-Integer Array containing ARGB values

java,android,arrays,image,bitmap
Currently I have a 2D integer Array containing ARGB values of an image. Now I want to get a Bitmap with those values to display it on the screen. The Bitmap should get scaled as well, for example the image is 80x80 or 133x145, but I only want it to...

JNI C++ to Java 32 bit image not showing properly

java,c++,colors,bitmap,jni
I have the following C++ code for JNI And the following Java code to create a 32bit bufferedimage, the sizes are also received through JNI Everything seems to work only that I have some weird colors in the image and I don't know how to get it right Result of...

Why i cannot show my byte[] image after converting it from bitmap?

java,android,bitmap,bytearray,scale
I'm trying to write a method that accepts an image(Bitmap) and returns a byte[] array. finally, I try to write this byte[] array to a folder so I can see the difference, but my byte[] arraycan not displayed, and in addition, it is not scaled down! This is my method:...

Android - AlertDialog won't show BitmapDrawable

android,bitmap,alertdialog,bitmapdrawable
In my app, I'm downloading a small Facebook profile picture and show it in an AlertDialog (as BitmapDrawable) along with the user first and last name. Now, my problem is that on some devices the BitmapDrawable is shown in the AlertDialog (Android ~4.0) and on some it isn't (5.0 and...

Bitmap quality using glReadPixels with frame buffer objects

android,opengl-es,bitmap
I have the following issue when exporting a bitmap from frame buffer object on Android using OpenGL 2. I have an image loaded into OpenGL and shown on the screen. The loaded image is bigger than the actual screen, thus I do some matrix manipulation to fit it on the...

android - best way to load multiple images locally

android,image,caching,bitmap
what is the best approach to load multiple images from local android device? do i still need to cache the bitmap or should i just load the bitmap directly to imageview? is there a library that you can recommend? i have read about other libraries such as glide, picasso, etc....

How to go from raw Bitmap data to SDL Surface or Texture?

c++,bitmap,textures,sdl,surface
I'm using a library called Awesomium and it has the following function: void Awesomium::BitmapSurface::CopyTo ( unsigned char * dest_buffer, // output int dest_row_span, // input that I can select int dest_depth, // input that I can select bool convert_to_rgba, // input that I can select bool flip_y // input that...

Android: int array set null but still in memory after GC

android,memory-leaks,bitmap
I tried to break it down to the main code regarding the pix array: public class BitmapProcessor { int[] pix; public Bitmap run(Bitmap b) { pix = new int[picw * pich]; bitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); // do some stuff bm = Bitmap.createBitmap(picw, pich, Bitmap.Config.ARGB_8888); bm.setPixels(pix, 0, picw,...

How do I get onTouch events to draw correctly on a zoomable imageview with canvas?

android,canvas,bitmap
I'm trying to draw using onTouch events on a Canvas over an Imageview that is pinchable/zoomable. It works perfectly if the image is fullscreen (and proportioned to the size of the screen), but once you zoom in on the image, the drawing point is not the same place as where...

Android recycled bitmap error

android,canvas,bitmap,imageview,recycle
I'm goning to resize bitmap and insert into imageView. However I encountered recycle error... error message : 05-08 13:32:48.948: E/AndroidRuntime(4792): Process: com.test.myapp, PID: 4792 05-08 13:32:48.948: E/AndroidRuntime(4792): java.lang.RuntimeException: Canvas: trying to use a recycled bitmap [email protected] 05-08 13:32:48.948: E/AndroidRuntime(4792): at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1225) 05-08 13:32:48.948: E/AndroidRuntime(4792): at...

How can I put a device-independent bitmap into the Windows clipboard using just direct WinAPI? (No MFC or other wrappers)

c++,bitmap,clipboard,alpha,dib
I've been trying to get this to work for awhile now, but I can't seem to figure it out, and hours of Googling has yet to reveal any useful results. I have an array of 32-bit pixels in RGBA order, and I want to create a device-independent bitmap from them...

BitmapFactory.DecodeByteArrayAsync JPEG is 77KB resulting Bitmap is 1.6MB

android,bitmap,xamarin,jpeg
I'm downloading some regular JPEG files and I have verified the file size. They are 77KB and can be viewed in my browser. ImageBytes.Length verifies this file size. However, imageBitmap.byteCount is 1638400 bytes. What am I missing? BitmapFactory.DecodeByteArrayAsync creates usable files, but they are huge. public async static Task<Bitmap> GetImageBitmapFromUrl(string...

Scaling an image and place it in the specific location (coordinates) in Android's LinearLayout

java,android,bitmap,scaling
I'm not very skilled in android application developing, and I'm working on a test app. I detected the face and the eyes, now I'm going to draw something like acne or scar on the face (e.g below the eyes on the cheek) based on the coordinates of the eyes. Later,...

Apply multiple effect on bitmap without saving it

android,image-processing,bitmap,textures,effect
My requirement is to load multiple Effect on bitmap. I am following apply-effects-on-image-using-effects for it. I got success for applying the effect but My requirements is to give brightness effect separately. That means user can able to give Brightness effect after applying any other effect without saving the file. I...

When I load a new image in a TBitmap I must destroy the existing one first?

delphi,bitmap,delphi-2009
I am loading multiple images from resources in a TImageList at runtime with this code: Bitmap:=TBitmap.Create; MyIcons:=TImageList.Create(self); Bitmap.LoadFromResourceName(HInstance,'DEFAULT16'); MyIcons.AddMasked(BitMap,clRed); Bitmap.LoadFromResourceName(HInstance,'FOLDER16'); MyIcons.AddMasked(BitMap,clRed); Bitmap.LoadFromResourceName(HInstance,'BACK16'); MyIcons.AddMasked(BitMap,clRed); Bitmap.Free; I want to know if I should destroy the previous bitmap (Bitmap.Assign(nil)) when I load a new one or this is done automatically in...

take a screenshot in android then use it in another activity

android,bitmap,screenshot
So I have seen alot of questions and answers on how to take a screenshot and save it to external storage, but what I would like to know is how after I have done this I can read it into the next activity, I will also be using the image...

Use cases for Redis SETBIT, GETBIT, BITCOUNT?

bitmap,redis
After reading Can someone explain redis setbit command? and http://blog.getspool.com/2011/11/29/fast-easy-realtime-metrics-using-redis-bitmaps/ (referenced in the redis docs) I'm still struggling to identify use cases for using SETBIT over SET. The above sources seems to be citing a driving factor for using SETBIT for storing events and 'countable' datasets in binary as it...

Bitmap connection error

android,android-studio,bitmap
I'm making an android studio application which in one of its tabs has a rss feed and now with the addition of the image and bitmap code, whit it I try to put my image to imageview, to my adapter whenever I run my code it crashes: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1147)...

Save bitmap to app folder

android,bitmap
When my app first starts, it lets the user select a profile picture. This can be done taking a photo at the moment, or selecting it from the gallery. After the user gets a picture, this must be saved in the device's internal storage, and will be used in the...

MPAndroidChart how to set a dual-background color on the chart

android,bitmap,mpandroidchart
I am using the latest MPAndroidChart library, and I was wondering if there is way to set a dual-background color on the chart. I need the colors to match a certain number of days that will be displayed on the x-axis. I would like to be able to do this...

Android Bitmap on Canvas from External File

android,canvas,bitmap,drawable
I use the following code to get a bitmap from the resources folder put it into a drawable and paint it to the canvas Drawable f = getResources().getDrawable(R.drawable.harris1); f.setBounds(a,120,a+200,270); f.draw(canvas); I want to be able to get the bitmap from my pictures directory on my device and paint it on...

How to resolve Out of Memory Error on Bitmap in Android?

android,android-intent,android-activity,bitmap
I want to set an image in image view,I am retrieving the image path in my first activity and I am passing it via intent as a String to second activity.In the second activity I set the path to an image view,It is working properly , and I need to...

Android bitmap processing - no leak but still OOM?

android,memory-leaks,bitmap
I'm writing a camera app and when I take a picture, I receive a byte [], decode it into a Bitmap and rotate it before saving it to JPEG. I'm rotating the photo using a native library, however the bitmap is still decoded from a byte[] into memory for this...

fast converting Bitmap to BitmapSource wpf

c#,wpf,bitmap,copy,bitmapsource
I need to draw an image on the Image component at 30Hz. I use this code : public MainWindow() { InitializeComponent(); Messenger.Default.Register<Bitmap>(this, (bmp) => { ImageTarget.Dispatcher.BeginInvoke((Action)(() => { var hBitmap = bmp.GetHbitmap(); var drawable = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap( hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); DeleteObject(hBitmap); ImageTarget.Source = drawable; })); }); } The problem is,...

Convert Image 16bits grayscale to Bitmap 16bits grayscale (Constructor error)

c#,image,bitmap,grayscale,opencvsharp
I try to convert a Image (16bits grayscale) to Bitmap (16bits grayscale). This example doesn't works (Exception : ArgumentException) private Mat ToMat16bGrayscale(Image im) { Bitmap bmp2 = new Bitmap(im); } But this example works : private Mat ToMat16bGrayscale(Image im) { //Cast obligatoire la création ou la copie d'une bitmap ne...

Rotate Image from URI and save the rotated image to the same place

android,image,bitmap,save,uri
I'm trying to create a Bitmap from an existing URI, rotate the Bitmap and save it to the same place as a JPEG file. This is my current code after having tried several solutions: try { // Get the Bitmap from the known URI. This seems to work. Bitmap bmp...

How to reduce image without losing quality and preserving the aspect ratio? [duplicate]

java,android,bitmap
This question already has an answer here: Strange out of memory issue while loading an image to a Bitmap object 38 answers I have image 3264х2448. I load it in bitmap crudeImage = BitmapFactory.decodeFile(picturePath); then set to the ImageView imageCrop.setImageBitmap(crudeImage); the problem is that it very big(3264х2448) and my...

WebView.draw() not properly working on latest Android System WebView Update

android,webview,bitmap
I'm currently using WebView.draw() to take a screenshot of the entire WebView and save it into a Bitmap (based off of this solution). It has worked perfectly up until now. I was recently testing this functionality on a Nexus 5 (please note that on the Nexus 5 the WebView in...

ImageView size is not displayed correctly

android,gridview,bitmap,imageview,android-gridview
I'm having a problem of displaying ImageViews with the correct size. Almost all the posts that I've read through involves ImageViews that are created in the layout file. However in my case, I'm creating ImageViews programmatically. I'm trying to display all images from a particular folder located in the storage....

Writing Byte Values in Bitmap Header To File

c++,bitmap,hex
I'm trying to write a bitmap header to file. For the moment, I just want to write the header without any pixel data. I'm basing the values on this, this, and this. I have the following function for composing a standard, uncompressed 24bit RGB bitmap header as a uint8_t: uint8_t*...

Crop Bitmap using RectF parameters on Android

android,image,bitmap,zoom,crop
Using MikeOrtiz's awesome ImageView implementation with touch and zoom events, I wanted to crop a picture taken with the camera to match the zoom. Using his method... // Return a Rect representing the zoomed image. RectF getZoomedRect(); ...I tried cropping the resulting picture bitmap to the zoom size like so:...

Android Bitmap Pixel operations return black square

java,android,bitmap
I have a method which is supposed to change Saturation and Lightness for all pixels of a bitmap. Code: public static Bitmap change(Bitmap b){ Bitmap newBitmap = Bitmap.createBitmap(b.getWidth(), b.getHeight(), Bitmap.Config.ARGB_8888); for(int x = 0; x < newBitmap.getWidth(); x++){ for(int y = 0; y < newBitmap.getHeight(); y++){ float[] hsv = new...

C++ Bitmap Resource (RT_BITMAP) and PNG Image Format

c++,bitmap,png
An application I'm developing displays various PNG images to the user in a window, and it works fine. My question is more on the grounds on HOW my PNG's are stored in the PE. Currently, the PNG's are stored in the executable as a resource, under the RT_RCDATA Resource Type,...

Convert Android image into a file that MATLAB can read

android,image,matlab,image-processing,bitmap
I´m working on a project related with image recognition using MATLAB and I'm currently using an Android app to help with some pre-processing steps. I thought it was going to be easy to work with matrices instead of bitmaps. I finally managed to finish my algorithm and to import it...

convert string into bitmap got null

android,bitmap
Update What i want to do is render a string as a Bitmap. For example if the string of the string instance are "hello world", then resulting Bitmap will be an image of the same letters and ready to use with an ImageView. I've tried the code below, but "bitmap"...