1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

pythonに関する自分用メモ

Last updated at Posted at 2021-12-06

○画面サイズを取得するには,pipでインストールが必要。
anaconda promptで

pip install screeninfo

○pyinstallerでアイコンを変更する方法
--icon==***.ico を加えることで、アイコンを設定。
exe化する .py と同一ディレクトリに ***.ico ファイルを置いておくと簡単。

○画像をフォルダから選択して表示

import tkinter.filedialog as fd
import cv2

global file_path,img1,winName
file_path = fd.askopenfilename(
    title = "画像を選択"
)

img1 = cv2.imread(file_path)
winName = 'image'
cv2.imshow(winName, img1)
cv2.waitKey(0)  ←即時終了防止
cv2.destroyAllWindows()

○画像オープンエラー
ファイル名が日本語だと、エラーになることがある。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?