C\#picturebox 컨트롤 에 그림 선택 상 태 를 추가 하 는 두 가지 방법
816 단어 picturebox그림 선택
간단 한 방법 은 picturebox 컨트롤 의 borderstyle 스타일 을 바 꾸 는 것 입 니 다.
currentSelectPicBox.BorderStyle = BorderStyle.Fixed3D; currentSelectPicBox.Refresh();//강제 컨트롤 다시 그리 기
방법 2
picturebox 컨트롤 에 직사각형 상 자 를 추가 합 니 다. 그러나 이런 방법 은 프로그램 에서 반응 이 비교적 느리다.
사각형 상자 추가 방법: Graphics pictureborder = currentSelectPicBox.CreateGraphics(); Pen pen = new Pen(Color.Red, 2); pictureborder.DrawRectangle(pen, currentSelectPicBox.ClientRectangle.X, currentSelectPicBox.ClientRectangle.Y, currentSelectPicBox.ClientRectangle.X + currentSelectPicBox.ClientRectangle.Width, currentSelectPicBox.ClientRectangle.Y + currentSelectPicBox.ClientRectangle.Height);직사각형 상 자 를 제거 하 는 방법
currentSelectPicBox.Invalidate();
여러분 이 더 좋 은 방법 이 있다 면 저희 와 함께 나 눌 수 있 었 으 면 좋 겠 습 니 다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
안 드 로 이 드 는 그림 을 선택 하 는 예제 코드 를 작성 합 니 다.달성 할 수 있 는 효과 첫 번 째 사진 의 위치 에 카 메 라 를 놓 고 카 메 라 를 클릭 하여 엽 니 다 4.567917.나머지 는 저 장 된 모든 그림 을 표시 하고 한 번 클릭 하면 큰 그림 을 볼 수 있 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.