ImageView setImageBitmap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ImageView setImageBitmap method.

This code example shows how to use the following methods:setLayoutParams, setPadding, setImageBitmap, setScaleType
        } 
 
        public View getView(int position, View convertView, ViewGroup parent) {
            ImageView imageView;
            if (convertView == null) {
                imageView = new ImageView(mContext);
                imageView.setLayoutParams(new GridView.LayoutParams(50, 50));
                imageView.setScaleType(ImageView.ScaleType.FIT_XY);
                imageView.setPadding(4, 4, 4, 4);
            } else { 
                imageView = (ImageView) convertView;
            } 
 
 
            imageView.setImageBitmap(emotions.get(index.get(position)));
            return imageView;
        } 
 
 
    } 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTag, invalidate, setImageBitmap
    return(result);
  } 
 
  @Override 
  protected void onPostExecute(Bitmap bitmap) {
      if (path.equals(image.getTag())) {
        image.setImageBitmap(bitmap);
        image.invalidate();
      } 
       
      if (ex!=null) {
        Log.e("ImageLoadTask", "Exception loading image", ex);
      } 
  } 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:clearAnimation, getAnimation, getContext, getTag, setTag
 
    ImageView view = getView();
    if (view == null)
      return; 
 
    if (!equals(view.getTag()))
      return; 
 
    view.setTag(null);
    if (result != null) {
      if (fadeIn && view.getAnimation() == null)
        view.startAnimation(AnimationUtils.loadAnimation(view.getContext(),
            android.R.anim.fade_in));
      view.setImageBitmap(result);
    } else { 
      view.setImageDrawable(null);
      view.clearAnimation();
    } 
  } 
} 

8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setLayoutParams, setPadding, setImageBitmap, setScaleType
	// Create the view for each user status 
	// [FIXME] Should be put as an XML file (possible?) 
	 
	private View makeUserStatusView(Context context, TwitterEntry entry) {
 
    	ImageView iv = new ImageView(context);
    	Bitmap photo = BitmapCache.getInstance().get(entry.getUser().getProfileImageURL());
 
    	iv.setImageBitmap(photo);
    	iv.setScaleType(ScaleType.CENTER);
    	iv.setPadding(0, 4, 4, 0);
    	iv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
	 
    	TextView tv = new TextView(context);
    	tv.setText(entry.getUser().getName() + ": " + entry.getText());
    	tv.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
	 
    	LinearLayout layout = new LinearLayout(context);
    	layout.setOrientation(LinearLayout.HORIZONTAL);
    	layout.setPadding(4, 2, 4, 2);
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setAlpha, setBackgroundColor, setImageBitmap
This code example shows how to use the following methods:getAnimation, startAnimation, setImageBitmap
	public Context getContext() {
		return imageView.getContext();
	} 
 
	public void setBitmap(Bitmap bitmap) {
		imageView.setImageBitmap(bitmap);
 
        stopExistingAnimation(); 
        if (animation != null) {
            imageView.startAnimation(animation);
        } 
	} 
 
    private void stopExistingAnimation() { 
        Animation old = imageView.getAnimation();
        if (old != null && !old.hasEnded()) {
            old.cancel();
        } 
    } 
 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setImageBitmap
		this.roundPixels = roundPixels;
	} 
 
	@Override 
	public Bitmap display(Bitmap bitmap, ImageView imageView, LoadedFrom loadedFrom) {
		Bitmap roundedBitmap = roundCorners(bitmap, imageView, roundPixels);
		imageView.setImageBitmap(roundedBitmap);
		return roundedBitmap;
	} 
 
	/** 
	 * Process incoming {@linkplain Bitmap} to make rounded corners according to target {@link ImageView}.<br /> 
	 * This method <b>doesn't display</b> result bitmap in {@link ImageView} 
	 * 
	 * @param bitmap      Incoming Bitmap to process 
	 * @param imageView   Target {@link ImageView} to display bitmap in 
	 * @param roundPixels 
	 * @return Result bitmap with rounded corners 
	 */ 
	public static Bitmap roundCorners(Bitmap bitmap, ImageView imageView, int roundPixels) {
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setBackgroundColor, setPadding, setImageBitmap
 
        v.setDrawingCacheEnabled(true);
        mFloatBitmap = Bitmap.createBitmap(v.getDrawingCache());
        v.setDrawingCacheEnabled(false);
 
        ImageView iv = new ImageView(mListView.getContext());
        iv.setBackgroundColor(mFloatBGColor);
        iv.setPadding(0, 0, 0, 0);
        iv.setImageBitmap(mFloatBitmap);
 
        return iv;
    } 
 
    /** 
     * Removes the Bitmap from the ImageView created in onCreateFloatView() and 
     * tells the system to recycle it. 
     */ 
    @Override 
    public void onDestroyFloatView(View floatView) {
        ((ImageView)floatView).setImageDrawable(null);
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setImageBitmap, setVisibility
			if (isCancelled())
				return; 
			 
			ImageView imgView = imgViewRef.get();
 
			if (imgView != null && AsyncDrawable.getTask(imgView) == this) { //make sure the ImageView instance has not been reused for another page
				if (result != null) {
					imgView.setImageBitmap(result);
					imgView.setVisibility(View.VISIBLE);
				} 
 
				ProgressBar bar = getProgressBar();
				if (bar != null)
					bar.setVisibility(View.GONE);
				 
				FlipViewController controller = controllerRef.get();
				if (controller != null)
					controller.refreshPage(pageIndex);
			}			 
		} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTag, invalidate, setImageBitmap
    return(result);
  } 
 
  @Override 
  protected void onPostExecute(Bitmap bitmap) {
      if (path.equals(image.getTag())) {
        image.setImageBitmap(bitmap);
        image.invalidate();
      } 
       
      if (ex!=null) {
        Log.e("ImageLoadTask", "Exception loading image", ex);
      } 
  } 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java

Related ImageView setImageBitmap Questions & Answers:

Other ImageView setImageBitmap Examples

45:	        bitmap = BitmapFactory.decodeStream(stream);
46:	
47:	        imageView.setImageBitmap(bitmap);
48:	      } catch (FileNotFoundException e) {
49:	        e.printStackTrace();

Read More

210:						options);
211:	
212:				imgPreview.setImageBitmap(bitmap);
213:			} catch (NullPointerException e) {
214:				e.printStackTrace();

Read More

39:	        Bitmap bitmap=memoryCache.get(url);
40:	        if(bitmap!=null)
41:	            imageView.setImageBitmap(bitmap);
42:	        else
43:	        {

Read More

315:	
316:			protected void onPostExecute(Bitmap result) {
317:				bmImage.setImageBitmap(result);
318:			}
319:		}

Read More

setImageBitmap Method Overview
Sets a Bitmap as the content of this ImageView.
See Code Examples for other Android ImageView Methods: