송신 수신. 이런 것 만들지 마시고 폼에 마우스로 글자가 부드럽게 쓰지는 프로그램을 만들어 보세요 이게 되어야 송수신이 의미가 있습니다
제가 보기에 송신측에서도 그냥직선만 그려질 것 같습니다.
부드러운 곡선을 구현하려면 비스프라인 곡선, 안티알리아싱 연구가 필요합니다.
소스보니 갈길이 멀게 느껴집니다.
18년 전에 제가 정보를 올렸는데 데브피아로 기억됩니다 아직 데브피아가 되는지 모르겠지만....
태블릿으로 글 쓰는게 넘 힘들군요. 성공하시길. .
부산 가야에서 잠 못이루는 밤에 월천 올림
시동이 님이 쓰신 글 :
: 안녕하세요
:
: 통신 가능한 전자 칠판을 만들고 있습니다
: 마우스가 이미지에서 움직일 때 좌표를 전송하고,
: 그 좌표를 받아 LineTo로 그리는 방식을 사용하고 있는데
: 수신 받는 쪽에서 곡선이 부드럽게 그려지지 않고 각지게 그려지는 문제가 발생합니다.
: 어떻게 하면 곡선이 각지지 않고 송신창과 동일하게 그려질 수 있을까요?
:
: //--------------------------------------------------------------------------------
:
: void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender, TCustomWinSocket *Socket) //클라이언트로부터 메세지 수신
: {
: int i;
: AnsiString Read, Prot;
: Read=Socket->ReceiveText();
:
: Prot=Read.SubString(1, 2);
: Read=Read.Delete(1, 2);
: if(Prot=="00")
: {
: {
: float Width_Ratio=StrToInt(Read.SubString(1, Read.Pos("^")-1)); //변수 Width_Ratio(임시)에 수신한 width값 저장
: Width_Ratio=(Image1->Picture->Bitmap->Width)/(Width_Ratio); //진짜 Width_Ratio 계산
: Read=Read.Delete(1, Read.Pos("^"));
:
: float Height_Ratio=StrToInt(Read.SubString(1, Read.Pos("^")-1)); //변수 Height_Ratio(임시)에 수신한 Height값 저장
: Height_Ratio=(Image1->Picture->Bitmap->Height)/(Height_Ratio); //진짜 Height_Ratio 계산
: Read=Read.Delete(1, Read.Pos("^"));
:
: int x=StrToInt(Read.SubString(1, Read.Pos("^")-1));
: x=x*Width_Ratio;
: Read=Read.Delete(1, Read.Pos("^"));
: int y=StrToInt(Read.SubString(1, Read.Pos("^")-1));
: y=y*Height_Ratio;
: Read=Read.Delete(1, Read.Pos("^"));
:
: Image1->Picture->Bitmap->Canvas->Pen->Color=StringToColor(Read.SubString(1, Read.Pos("^")-1));
: Read=Read.Delete(1, Read.Pos("^"));
:
: Image1->Picture->Bitmap->Canvas->Pen->Width=StrToInt(Read.SubString(1, Read.Pos("^")-1));
: Read=Read.Delete(1, Read.Pos("^"));
:
:
: Image1->Picture->Bitmap->Canvas->LineTo(x, y);
: }
: }
:
: //---------------------------------------------------------------------------
:
:
: void __fastcall TForm1::Image1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) //마우스
: {
: if(write==0)
: {
: MouseClick=true;
: Image1->Picture->Bitmap->Canvas->MoveTo(X,Y);
: Image1->Picture->Bitmap->Canvas->LineTo(X,Y);
:
: for (int i = 0; i < Client_Number; i++) {
: ServerSocket1->Socket->Connections[i]->SendText("00StartDrawing"+IntToStr(Image1->Picture->Bitmap->Width)+"^"+IntToStr(Image1->Picture->Bitmap->Height)+"^"+IntToStr(X)+"^"+IntToStr(Y)+"^");
:
: }
:
: }
: }
: //---------------------------------------------------------------------------
:
|