본문 바로가기

IMAGE6

Flutter 플러터에서 GridTile 내 이미지 위에 잉크웰 리플 효과 추가, InkWell ripple over top of image in GridTile in Flutter 질문 나는 사용자가 타일을 탭할 때 GridTile 안의 이미지 위에 리플 효과를 얻기 위해 InkWell을 사용하려고 시도하고 있습니다. 이미지 자체가 리플을 가리고 있는 것 같습니다. 이미지를 제거하면 리플이 보입니다. 아래는 단일 GridTile의 코드입니다. return new InkWell( onTap: () => debugPrint(s.displayName), highlightColor: Colors.pinkAccent, splashColor: Colors.greenAccent, child: new GridTile( footer: new GridTileBar( title: new Text(s.displayName), subtitle: new Text(s.gameName), backgroundC.. 2023. 12. 11.
Python 주피터 노트북에 이미지나 사진을 어떻게 삽입할 수 있을까요? 로컬 머신에서 또는 웹 리소스에서 삽입하는 방법에 대해 알려주세요., How to embed image or picture in jupyter notebook, either from a lo.. 질문 저는 주피터 노트북에 이미지를 포함시키고 싶습니다. 다음과 같이 하면 작동합니다 : from IPython.display import Image Image("img/picture.png") 하지만 이미지를 마크다운 셀에 포함시키고 싶으며, 다음 코드는 404 오류를 반환합니다 : ![title]("img/picture.png") 또한 다음을 시도해보았습니다 : ![texte]("http://localhost:8888/img/picture.png") 하지만 여전히 같은 오류가 발생합니다 : 404 GET /notebooks/%22/home/user/folder/img/picture.png%22 (127.0.0.1) 2.74ms referer=http://localhost:8888/notebooks/n.. 2023. 10. 26.
Python requests를 사용하여 이미지를 다운로드하는 방법은 다음과 같습니다., How to download image using requests 질문 나는 파이썬의 requests 모듈을 사용하여 웹에서 이미지를 다운로드하고 저장하려고 시도하고 있습니다. 다음은 사용한 (작동하는) 코드입니다: img = urllib2.urlopen(settings.STATICMAP_URL.format(**data)) with open(path, 'w') as f: f.write(img.read()) requests를 사용한 새로운 (작동하지 않는) 코드는 다음과 같습니다: r = requests.get(settings.STATICMAP_URL.format(**data)) if r.status_code == 200: img = r.raw.read() with open(path, 'w') as f: f.write(img) requests에서 응답으로부터 사용할 속성.. 2023. 10. 17.
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.