Skip to content Skip to sidebar Skip to footer

How To Create Image From Rgb Values In Android

i want to create an image from RGB values in android. Exemple of values: R=255,G=76,B=87 . then can you please tell me the steps to create an image from RGB values?

Solution 1:

I think you mean that XML drawables. You can check here. I mostly use XML drawable

For Example:

<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape=["rectangle" | "oval" | "line" | "ring"] ><cornersandroid:radius="integer"android:topLeftRadius="integer"android:topRightRadius="integer"android:bottomLeftRadius="integer"android:bottomRightRadius="integer" /><gradientandroid:angle="integer"android:centerX="integer"android:centerY="integer"android:centerColor="integer"android:endColor="color"android:gradientRadius="integer"android:startColor="color"android:type=["linear" | "radial" | "sweep"]
    android:useLevel=["true" | "false"] /><paddingandroid:left="integer"android:top="integer"android:right="integer"android:bottom="integer" /><sizeandroid:width="integer"android:height="integer" /><solidandroid:color="color" /><strokeandroid:width="integer"android:color="color"android:dashWidth="integer"android:dashGap="integer" /></shape>

Solution 2:

create a white color transparent image then convert it into mutable bitmap then change color of bitmap and again set bitmap to imageview.

Post a Comment for "How To Create Image From Rgb Values In Android"