我无法在ReactJS中调整大分辨率图像的大小



我正在使用这个库https://github.com/img-mapper/react-img-mapper

我有一个尺寸为15k x 8k的图像,我可以使用img组件正常调整其大小。

但是,使用库的组件,我无法调整它的大小。我尝试了以下3种调整大小的方法。

-我试着用宽度和高度来调整父div的大小。

<ImageMapper src={sampleIMG} map={MAP} imgWidth={200} natural /><ImageMapper src={sampleIMG} map={MAP} imgWidth={200} natural />

您是否尝试过width(图像宽度,在函数中您将获得图像参考对象(或parentWidth(响应的父级最大宽度(?

<ImageMapper 
src={URL} 
map={MAP}
width={props.width} // dynamic width
height={props.height} // dynamic height
imgWidth={props.imgWidth} // dynamic imgWidth
natural={props.natural} // dynamic natural
responsive={props.responsive} // dynamic responsive
parentWidth={props.parentWidth} // dynamic parentWidth
/>

最新更新