Android Developers
1.23K subscribers
164 photos
4 videos
57 files
59 links
Here You Can Get Android App Development Tutorials For Free

LinkTree
https://linktr.ee/androiddeveloperspage

For Comments & Feedback
@androiddevstutorialscommentbot

Contact Me
@SE_BIBEL_MEK
Download Telegram
How To Resize Image Using OpenCV

To Resize Image Using OpenCV Follow The Following Steps.

Step1. In The View Area Add ImageView Or Any Other Image Displaying View.

Step2. Make Sure You Select OpenCV Android SDK In The Library Manager.

Step3. In The Custom Imports Add The Following Classes From OpenCV.

import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.android.Utils;
import android.graphics.Bitmap;
import org.opencv.imgproc.Imgproc;
import org.opencv.imgcodecs.Imgcodecs;
import android.graphics.drawable.BitmapDrawable;

Step4. Load OpenCV C++ Binary Using The Following Code.

}
static {
System.loadLibrary("opencv_java4");
}
{

Step5. In Any Event You Want(OnCreate, OnButton Click Or Any Other Event) Where You Want To Resize The Image Use This Code. Read Comment's For Better Understanding.

//Get Bitmap From ImageView Called imageview1

Bitmap bitmap = ((BitmapDrawable) imageview1.getDrawable()).getBitmap();

//Initialize Mat Object For The Bitmap

Mat mat = new Mat();

//Convert The Bitmap From imageview1 To OpenCV Mat Object.

Utils.bitmapToMat(bitmap, mat);

//Initialize Mat Object For The Resized Image

Mat resizedmat = new Mat();

//Resize The Image From Mat Object With New Width 512 & Height 512

Imgproc.resize(mat, resizedmat, new Size(seekbar1.getProgress(), seekbar1.getProgress()));

//Create Bitmap From The Resized Mat Object Columns & Rows.

Bitmap resizedbitmap = Bitmap.createBitmap(resizedmat.cols(), resizedmat.rows(), Bitmap.Config.ARGB_8888);

//Convert The Resized Mat Object To Bitmap

Utils.matToBitmap(resizedmat, resizedbitmap);

//Display The Resized Bitmap In imageview1

imageview1.setImageBitmap(resizedbitmap);

//Release The Mat Objects To Prevent Memory Leaks

mat.release();
resizedmat.release();
OpenCV Image Resizer Sketchware Pro Project
โค1
Android Developers pinned ยซWhat Did You Feel About The OpenCV Tutorialยป
Android Developers pinned ยซOpenCV Image Resizer Sketchware Pro Projectยป
Android Developers YouTube Channel Reaches 40 Subscribers.

๐Ÿ˜Š Thank You ๐Ÿ˜Š

@SE_BIBEL_MEK

๐Ÿ‘‰ @androiddevstutorial
๐Ÿ‘2
Sketchware Pro Nightly Version v6.4.0-SNAPSHOT-5f82376-minApi26
โš ๏ธ Caution โš ๏ธ

I've Tested This Sketchware Pro Nightly Build On realme RMX3381 Android13 Device & I Have Not Found Any Bugs(Except The Local Library Downloader Bug). But There May Be Some Unstablity Issues In Other Android Versions. So I Highly Recommend You To Backup Your .sketchware Folder Before Trying This One. If You Want The Latest Stable Build Of Sketchware Pro You Can Download It From Here. Otherwise Enjoy The New Features & Bug Fixes.

@SE_BIBEL_MEK

๐Ÿ‘‰ @androiddevstutorial
๐Ÿ‘1
Channel photo updated
How To Install Kotlin In Android Using Termux

Kotlin is a modern programming language developed by JetBrains, designed to be fully interoperable with Java and enhance the development experience for Android and other applications. Here are some key features of Kotlin:

* Concise Syntax: Kotlin aims to reduce boilerplate code, making it more concise and readable compared to Java.

* Null Safety: It includes built-in null safety features, helping to eliminate the risk of null pointer exceptions by distinguishing between nullable and non-nullable types.

* Interoperability: Kotlin can seamlessly interact with Java code, allowing developers to use existing Java libraries and frameworks.

In This Post We're Going To Learn How To Install Kotlin & Run Our First Kotlin Program In Android Using Termux.

Step1. If You Don't Have Termux App Installed On Your Android Device You Can Install It From Here.