Click here to Skip to main content
15,393,622 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team

I need some help, i want to reduce the size and width of my image, i want to know how to do this on local path as well via URL, based on my given logic below.

What I have tried:

JavaScript
<pre lang="Javascript">
/**
 * The content for the web application.
 */

 import React, { Component } from 'react';

 // function loads the image from rest api not from local directory
 function Content () {
   
     return (
       
           <img alt="expo" src={require('./images/drone_image.png')} />
       
     )
   
 }
 
 export default Content
Posted
Updated 25-Jun-22 4:39am

1 solution

You can use the relevant attributes of the HTML img tag[^].
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900