Programming/c# & winform2020. 10. 30. 15:21

말이 이상하네 -ㅁ-

원본 이미지는 큰데 출력할 PictureBox는 작고

그 PictureBox 위에서 클릭 드래그 하면 사진이 움직이는 것을 구현하려고 한참을 고생했는데

결과물은 딸랑 두줄 -_-

 

        private void OnMouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button.HasFlag(MouseButtons.Left))
            {
                Bitmap bmp = global::testproject.Properties.Resources.septa_map;
                pictureBox2.CreateGraphics().DrawImage(bmp, new Point(e.X, e.Y));
            }
        }

[링크 : https://www.c-sharpcorner.com/.../how-to-make-image-editor-tool-in-C-Sharp-cropping-image/]

[링크 : https://docs.microsoft.com/ko-kr/dotnet/api/system.windows.forms.mousebuttons?view=netcore-3.1]

 

 

+

중간에 아무생각 없이 new Bitmap 엄청했더니 OutOfMemory 에러를 보지 않나 난리 법석이었네

Posted by 구차니
Programming/c# & winform2020. 10. 30. 12:26

접근제한자를 아무생각없이 써서 발생한 문제 -_ㅠ

 

"일관성 없는 접근성: ‘type’ 매개 변수 형식이 ‘method’ 메서드보다 접근성이 부족합니다."

내용대로 매개변수의 접근성이 method의 접근성보다 낮을 경우 발생한다.

 

 

그러니까

메소드는 public 인데

인자는 private 형일때 발생했다.

 

[링크 : https://docs.microsoft.com/ko-kr/dotnet/csharp/language-reference/compiler-messages/cs0051]

Posted by 구차니
Programming/c# & winform2020. 10. 30. 12:09

특이하게도.. 색상 지정할때는 값을 주면 되는데

기본 색상으로 하려면 new를 해주어야 한다.

 

if (lblExample.ForeColor != System.Drawing.Color.Red)
{
    lblExample.ForeColor = System.Drawing.Color.Red;
}
else
{
    lblExample.ForeColor = new System.Drawing.Color();
}

[링크 : https://stackoverflow.com/.../how-to-programmatically-set-the-forecolor-of-a-label-to-its-default]

Posted by 구차니
Programming/c# & winform2020. 10. 30. 11:47

어떻게 여러개의 값을 넣을 방법이 있을 것 같아서 찾아보는데

"항목 편집" 을 누르면 "문자열 컬렉션 편집기" 라는게 뜨고

엔터로 구분해서 입력해 주면 자동으로 Item에 추가된다.

Items나 Text에 해주어야 하는줄 알았는데 그냥 "항목 편집"을 누르면 된다.

 

반대로 다국어 지원시 문자열을 넣는걸 찾아봐야겠네..

 

 

            // 
            // comboBox_direction
            // 
            this.comboBox_direction.FormattingEnabled = true;
            this.comboBox_direction.Items.AddRange(new object[] {
            "Forward",
            "Backward",
            "Neutral"});
            this.comboBox_direction.Location = new System.Drawing.Point(65, 220);
            this.comboBox_direction.Name = "comboBox_direction";
            this.comboBox_direction.Size = new System.Drawing.Size(121, 20);
            this.comboBox_direction.TabIndex = 4;

 

 

[링크 : https://docs.microsoft.com/ko-kr/dotnet/api/system.windows.forms.combobox?view=netcore-3.1]

Posted by 구차니
개소리 왈왈/컴퓨터2020. 10. 30. 11:20

회사에 다른분이 쓰시는 노트북에서 잠시 빌려서 써보니

1. 펜촉이 약간 고무 재질이라 미끌리지 않아 좋음

2. 아쉽게도 지우개 버튼은 없음

3. 펜촉이 2760p용 펜과 호환되지 않음(확연히 가늘은 녀석)

 

[링크 : http://itempage3.auction.co.kr/DetailView.aspx?itemno=B477816670]

 

그렇다고 노트5용을 쓰기에는 너무 얇아서 쥐는 느낌이 별로인데다가 지우개도 없는데 고민되네

Posted by 구차니
개소리 왈왈/컴퓨터2020. 10. 30. 11:16

막 프리징 생기고 난리인걸 보니 또 맛이 가려는 징조가..

리눅스 설정이 문제인가 아니면 ADATA가 문제인가.. 후...

 

[ 1975.757612] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 1975.757616] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
[ 1975.757619] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
[ 1975.757623] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
[ 1975.757626] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 1975.757632] Buffer I/O error on dev sdb, logical block 0, async page read
[ 1975.829640]  sdb: unable to read partition table
[ 1975.829652] sdb: partition table beyond EOD, enabling native capacity
[ 1975.859622] sd 6:0:0:0: [sdb] Sector size 0 reported, assuming 512.
[ 1977.190552] usb 1-1.6: reset high-speed USB device number 6 using ehci-pci
[ 1977.807091] sd 6:0:0:0: Power-on or device reset occurred
[ 1977.841109] ldm_validate_partition_table(): Disk read failed.
[ 1977.985113] Dev sdb: unable to read RDB block 0
[ 1978.141123]  sdb: unable to read partition table
[ 1978.141137] sdb: partition table beyond EOD, truncated
[ 1978.149989] sd 6:0:0:0: [sdb] Spinning up disk...
[ 1979.178474] ..
[ 1980.209450] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1980.209454] sd 6:0:0:0: [sdb] Attached SCSI disk

 

+

디스크가 하나 뿐이라 sda sda1만 있어야 하는데 갑자기 나타난 sdb.. 넌 정체가 머냐..

리부팅 하면서 로그가 안남아 있으니 갑갑하네 ㅠㅠ

 

+

혹시나 smart 정보 돌려보는데(확장) 문제 없음.

켜진 시간이 4일 밖에 안되는데 도대체 왜??!?!!?

 

+

syslog 뒤져보는데 sdb.. 도대체 왜?!?!!?

Oct 30 11:11:04 mini2760p kernel: [ 1974.873670] scsi host6: scsi scan: INQUIRY result too short (5), using 36
Oct 30 11:11:04 mini2760p kernel: [ 1974.873676] scsi 6:0:0:0: Direct-Access                                    PQ: 0 ANSI: 0
Oct 30 11:11:04 mini2760p kernel: [ 1974.874123] sd 6:0:0:0: Attached scsi generic sg1 type 0
Oct 30 11:11:04 mini2760p kernel: [ 1974.906257] sd 6:0:0:0: [sdb] Sector size 0 reported, assuming 512.
Oct 30 11:11:04 mini2760p kernel: [ 1974.906265] sd 6:0:0:0: [sdb] 1 512-byte logical blocks: (512 B/512 B)
Oct 30 11:11:04 mini2760p kernel: [ 1974.906267] sd 6:0:0:0: [sdb] 0-byte physical blocks
Oct 30 11:11:04 mini2760p kernel: [ 1974.922667] sd 6:0:0:0: [sdb] Write Protect is off
Oct 30 11:11:04 mini2760p kernel: [ 1974.922671] sd 6:0:0:0: [sdb] Mode Sense: 00 00 00 00
Oct 30 11:11:04 mini2760p kernel: [ 1974.938129] sd 6:0:0:0: [sdb] Asking for cache data failed
Oct 30 11:11:04 mini2760p kernel: [ 1974.938134] sd 6:0:0:0: [sdb] Assuming drive cache: write through
Oct 30 11:11:04 mini2760p kernel: [ 1974.988675] sd 6:0:0:0: [sdb] Sector size 0 reported, assuming 512.
Oct 30 11:11:04 mini2760p kernel: [ 1975.097790] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.097796] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.097799] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.097803] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.097807] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.097812] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:04 mini2760p kernel: [ 1975.169774] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.169778] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.169780] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.169782] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.169785] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.169789] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:04 mini2760p kernel: [ 1975.241867] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.241870] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.241872] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.241875] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.241878] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.241882] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:04 mini2760p kernel: [ 1975.241895] ldm_validate_partition_table(): Disk read failed.
Oct 30 11:11:04 mini2760p kernel: [ 1975.313745] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.313750] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.313753] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.313757] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.313760] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.313767] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:04 mini2760p kernel: [ 1975.385778] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.385782] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.385784] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.385787] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.385790] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.385795] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:04 mini2760p kernel: [ 1975.461649] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:04 mini2760p kernel: [ 1975.461653] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:04 mini2760p kernel: [ 1975.461655] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:04 mini2760p kernel: [ 1975.461657] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:04 mini2760p kernel: [ 1975.461660] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:04 mini2760p kernel: [ 1975.461664] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:05 mini2760p kernel: [ 1975.533769] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:05 mini2760p kernel: [ 1975.533772] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:05 mini2760p kernel: [ 1975.533774] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:05 mini2760p kernel: [ 1975.533777] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:05 mini2760p kernel: [ 1975.533780] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:05 mini2760p kernel: [ 1975.533784] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:05 mini2760p kernel: [ 1975.533796] Dev sdb: unable to read RDB block 0
Oct 30 11:11:05 mini2760p NetworkManager[873]: <info>  [1604023865.1185] policy: set '유선 연결 1' (enp0s25) as default for IPv4 routing and DNS
Oct 30 11:11:05 mini2760p kernel: [ 1975.614163] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:05 mini2760p kernel: [ 1975.614169] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:05 mini2760p kernel: [ 1975.614172] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:05 mini2760p kernel: [ 1975.614177] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:05 mini2760p kernel: [ 1975.614180] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:05 mini2760p kernel: [ 1975.614186] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:05 mini2760p gsd-sharing[1388]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-user-share-webdav.service not loaded.
Oct 30 11:11:05 mini2760p gsd-sharing[1388]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit rygel.service not loaded.
Oct 30 11:11:05 mini2760p gsd-sharing[1388]: Failed to StopUnit service: GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-remote-desktop.service not loaded.
Oct 30 11:11:05 mini2760p kernel: [ 1975.685747] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:05 mini2760p kernel: [ 1975.685751] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:05 mini2760p kernel: [ 1975.685755] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:05 mini2760p kernel: [ 1975.685759] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:05 mini2760p kernel: [ 1975.685762] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:05 mini2760p kernel: [ 1975.685767] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:05 mini2760p kernel: [ 1975.757612] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Oct 30 11:11:05 mini2760p kernel: [ 1975.757616] sd 6:0:0:0: [sdb] tag#0 Sense Key : Medium Error [current] 
Oct 30 11:11:05 mini2760p kernel: [ 1975.757619] sd 6:0:0:0: [sdb] tag#0 Add. Sense: Recorded entity not found
Oct 30 11:11:05 mini2760p kernel: [ 1975.757623] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 01 00
Oct 30 11:11:05 mini2760p kernel: [ 1975.757626] blk_update_request: critical medium error, dev sdb, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Oct 30 11:11:05 mini2760p kernel: [ 1975.757632] Buffer I/O error on dev sdb, logical block 0, async page read
Oct 30 11:11:05 mini2760p kernel: [ 1975.829640]  sdb: unable to read partition table
Oct 30 11:11:05 mini2760p kernel: [ 1975.829652] sdb: partition table beyond EOD, enabling native capacity
Oct 30 11:11:05 mini2760p kernel: [ 1975.859622] sd 6:0:0:0: [sdb] Sector size 0 reported, assuming 512.
Oct 30 11:11:06 mini2760p kernel: [ 1977.190552] usb 1-1.6: reset high-speed USB device number 6 using ehci-pci
Oct 30 11:11:07 mini2760p kernel: [ 1977.807091] sd 6:0:0:0: Power-on or device reset occurred
Oct 30 11:11:07 mini2760p kernel: [ 1977.841109] ldm_validate_partition_table(): Disk read failed.
Oct 30 11:11:07 mini2760p kernel: [ 1977.985113] Dev sdb: unable to read RDB block 0
Oct 30 11:11:07 mini2760p kernel: [ 1978.141123]  sdb: unable to read partition table
Oct 30 11:11:07 mini2760p kernel: [ 1978.141137] sdb: partition table beyond EOD, truncated
Oct 30 11:11:07 mini2760p kernel: [ 1978.149989] sd 6:0:0:0: [sdb] Spinning up disk...
Oct 30 11:11:09 mini2760p kernel: [ 1979.178474] ..
Oct 30 11:11:09 mini2760p kernel: [ 1980.209450] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Oct 30 11:11:09 mini2760p kernel: [ 1980.209454] sd 6:0:0:0: [sdb] Attached SCSI disk

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

이것저것 처분중  (2) 2020.11.01
갤럭시 북 12용 펜  (0) 2020.10.30
아아 SD가 죽었습니다 ㅠㅠ  (0) 2020.10.22
lg gram 드라이버 프로그램 자동 실행 막기  (0) 2020.10.20
USB 사운드 카드 도착!  (0) 2020.10.19
Posted by 구차니