일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 파이썬
- DataGridView
- Spring Boot
- Java
- 도커
- 스프링부트
- git
- Python
- Spring
- c#
- react
- 리눅스
- 영어공부
- github
- Winform
- mybatis
- kubernetes
- 자바
- 리액트
- VOA
- 스프링
- 리팩토링
- 머신러닝
- MySQL
- docker
- machine-learning
- 쿠버네티스
- AWS
- 마이바티스
- springboot
Archives
- Today
- Total
보뇨 다이어리
PictureBox URL 이미지 가져오기 본문
반응형
코딩하던중 발생한것이 PictureBox 를 visible = false 하게 되면 아무리 이미지 URL 을 넣어도 image 에 초기화가 안된다는 문제점이 생김....
그래서 어떻게 해야하나 싶은와중에 역시 갓갓갓 스택오버플로우 찬양합니다
사용방법은 아래와 같다
1 2 | var webClient = new WebClient(); byte[] imageBytes = webClient.DownloadData("http://www.google.com/images/logos/ps_logo2.png"); | cs |
using 키워드를 활용하여 작성하는 방법도 존재한다
1 2 3 4 | string someUrl = "http://www.google.com/images/logos/ps_logo2.png"; using (var webClient = new WebClient()) { byte[] imageBytes = webClient.DownloadData(someUrl); } | cs |
출처
https://stackoverflow.com/questions/4599686/image-to-byte-array-from-a-url
반응형
'컴퓨터 관련 > C# 정보' 카테고리의 다른 글
dataGridView CurrentCell 이 null 인경우 (0) | 2019.03.28 |
---|---|
dataGridView selected row 인덱스 가져오기 (0) | 2019.03.15 |
MaskedTextBox 대신에 DateTimePicker 사용하기 (0) | 2019.01.14 |
comboBox 내부 string align center 로 맞추기 (4) | 2019.01.07 |
dataGridView 안에 특정 Row 감추기 (0) | 2018.12.12 |