MCLab Exp 8
MCLab Exp 8
Sem VI
Amisha Verma
Roll No 66
EXPERIMENT 8
Objective To develop Application that draws basic Graphical Primitives on the screen
Outcome Students learned application that draws basic Graphical Primitives on the
screen
Deliverables Android
Colab Link
//Activity_main.xml
<ImageView
android:layout_width="match_par
ent"
android:layout_height="match_par
ent"
android:id="@+id/imageView" />
</RelativeLayout>
//MainActivity.java
package com.example.myapplication;
import
androidx.appcompat.app.AppCompatActivit
y; import android.graphics.Bitmap;
import
android.graphics.Canv
as; import
android.graphics.Colo
r; import
android.graphics.Paint
;
import
android.graphics.drawable.BitmapDrawable
; import android.os.Bundle;
import android.widget.ImageView;
AppCompatActivity { @Override
//Creating a Bitmap
Bitmap bg = Bitmap.createBitmap(720, 1280,
Bitmap.Config.ARGB_8888);