Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paint a circular image with border

Tags:

flutter

dart

I want to do something like

new BoxDecoration(         color: const Color(0xff7c94b6),         image: new DecorationImage(           image: new ExactAssetImage('assets/images/restaurant.jpg'),           fit: BoxFit.cover,         ),         borderRadius: new BorderRadius.all(new Radius.circular(50.0)),         border: new Border.all(           color: Colors.red,           width: 4.0,          ), 

The visual I am looking for is like the way gmail shows the user's image. This code - which is from the docs - works fine, but my image should be loaded from a url, and is not in the assets.

like image 593
Arash Avatar asked May 31 '17 04:05

Arash


People also ask

How to remove the shape border from a picture?

Choose the picture that you saved in Step 1. Your picture will be inserted and contained flawlessly within the shape. Step 5: Right-click on the shape and select Format AutoShape. Our aim here is to remove the shape border. Step 6: Ensure to be on the Colors and Lines tab. Under Lines section, go to Color and select No Color.

How do I add a border to a photo?

Upload your photo or drag-n-drop it to the editor in JPG or PNG format. Once uploaded, use the border tool to apply an outline to your photo in our easy-to-use editor. Customize your border by adjusting its width, size, color & opacity until it looks just right.

How to make a circular sticker in Paint 3D?

Hit Make sticker from the sidebar. Now, open the image in Paint 3D on which you want to add this circular image. Go to Stickers at the top and click on the third icon on the right sidebar. You will find your cropped image here. Click on it to add to the base image. Adjust its position and size, and finally, save the image.

How do I crop a circle in MS Paint?

The steps are as follows: 1) load MS Paint, 2) search for and load the image, 3) select the shape, 4) bold the edges, 5) choose your color, 6) erase, and 7) save your image. The first step to circle cropping in Paint is to load MS Paint from your computer. You can easily do this by searching for it in the Windows search box.


1 Answers

NetworkImage is the class you are looking for.

screenshot

           Container(              width: 100.0,              height: 100.0,              decoration: BoxDecoration(                color: const Color(0xff7c94b6),                image: DecorationImage(                  image: NetworkImage('http://i.imgur.com/QSev0hg.jpg'),                  fit: BoxFit.cover,                ),                borderRadius: BorderRadius.all( Radius.circular(50.0)),                border: Border.all(                  color: Colors.red,                  width: 4.0,                ),              ),            ), 
like image 119
Collin Jackson Avatar answered Sep 18 '22 23:09

Collin Jackson