본문 바로가기

Resize2

Flutter 플러터에서 IconButton의 크기(높이와 너비)를 조정하는 방법은 무엇인가요?, How to resize (height and width) of an IconButton in Flutter 질문 Flutter에서 IconButton의 크기(높이와 너비)를 조절하는 방법은 무엇인가요? 기본적으로 기본 너비와 높이를 가지는 것 같습니다. 높이나 너비 속성이 없는 것 같습니다. new IconButton( padding: new EdgeInsets.all(0.0), color: themeData.primaryColor, icon: new Icon(Icons.clear, size: 18.0), onPressed: onDelete, ) 답변 다음과 같이 SizedBox를 사용하여 크기를 지정할 수 있습니다. SizedBox( height: 18.0, width: 18.0, child: IconButton( padding: EdgeInsets.all(0.0), color: themeData.prima.. 2023. 9. 22.
Python PIL을 사용하여 이미지 크기를 조정하고 종횡비를 유지하는 방법은 무엇인가요?, How do I resize an image using PIL and maintain its aspect ratio? 질문 이걸 놓친 명백한 방법이 있을까요? 썸네일을 만들려고만 하는 중입니다. 답변 최대 크기를 정의합니다. 그런 다음 min(maxwidth/width, maxheight/height)를 사용하여 크기 조정 비율을 계산합니다. 적절한 크기는 oldsize*ratio입니다. 물론 이를 수행하는 라이브러리 메서드도 있습니다: Image.thumbnail 메서드입니다. 아래는 PIL 문서에서 가져온 (편집된) 예제입니다. import os, sys import Image size = 128, 128 for infile in sys.argv[1:]: outfile = os.path.splitext(infile)[0] + ".thumbnail" if infile != outfile: try: im = Image... 2023. 9. 9.