Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] Fill ImageView With Colors in android

Posted on November 11, 2022 By

Solution 1 :

I would go with Canvas.
You can first draw solution, and then add drawing of the flask on top of that.

First, I’d measure the height of the flask in pixels so that I’d be able to calculate how much pixels in height does 1 unit of volume take. After that, you can add separate solutions based on number of units and start drawing at the top of last one.

Once you draw all the solutions, just draw image of flask on the same canvas.

Problem :

I run into a difficulty in my application.

I have an ImageView that represents a chemistry flask.
I would like that when I click on buttons of various colors, the ImageView is filled with the said color.

I would like a stack of each separate color but if you have a solution for mixing every color (maybe in a gradient ? it will be ok too)
I would have 12 colors at the end in total

The problem is that I don’t know how to do it.

Anyone have an idea?

Example:

Start

I click on a button which corresponds to the color blue :

enter image description here

Then I click on a button which corresponds to the color red:

enter image description here

READ  [FIXED] android - Data binding class not generated in latest studio 3.6
Powered by Inline Related Posts
Android Tags:android, colors, fill, imageview

Post navigation

Previous Post: [FIXED] android – Can you get the tag of a date picker
Next Post: [FIXED] Android Recyclerview add item and notifyiteminserted causes blink recycled view before draw the correct

Related Posts

[FIXED] ImageView doesn’t show image from intent in java android Android
[FIXED] git – Gitignore does not ignore folder android, react native Android
[FIXED] android – AR face filters with live stream using wowza engine Android
[FIXED] Android Studio recognises device, but not able to run code Android
[FIXED] Need to release another flutter android app from existing code Android
[FIXED] c++ – Android NDK: CMake fails while linking static library (OpenSSL) Android

Archives

  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • Can Vicks humidifier be used without filter?
  • What color is Spanish green?
  • How old is Jamie in The War That Saved My Life?
  • When should I use scalp massager for hair growth?
  • Can I put polyurethane over liming wax?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme