본문 바로가기

반응형
SMALL

delphi

stringgrid의 셀 병합하는 코드 Delphi StringGrid에서 셀을 병합하려면 OnDrawCell 이벤트를 사용하여 셀의 모양을 사용자 지정하고 병합된 셀처럼 보이게 할 수 있다. procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Grid: TStringGrid; Text: string; R: TRect; I, J: Integer; begin Grid := Sender as TStringGrid; if (ACol = 1) and (ARow = 1) then begin // Draw the merged cell Grid.Canvas.Font := Grid.Font; Grid.C.. 더보기
stringgrid에 체크박스 삽입하는 코드 procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Grid: TStringGrid; CheckBoxRect: TRect; begin Grid := Sender as TStringGrid; // Set checkbox for cell in column 2 if ACol = 2 then begin CheckBoxRect.Left := Rect.Left + ((Rect.Right - Rect.Left) - 13) div 2; CheckBoxRect.Top := Rect.Top + ((Rect.Bottom - Rect.Top) - 13) div 2; Che.. 더보기
stringgrid의 특정 셀의 색상을 변경하는 코드 procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var Grid: TStringGrid; begin Grid := Sender as TStringGrid; // Set color for cell in row 2 and column 3 if (ACol = 3) and (ARow = 2) then begin Grid.Canvas.Brush.Color := clRed; Grid.Canvas.FillRect(Rect); end; // Draw cell contents Grid.Canvas.Font := Grid.Font; Grid.Canvas.TextRect(R.. 더보기
Stringgrid의 숫자 포멧 설정 stringgrid의 셀에서 숫자의 실수형의 포멧을 지정하는 방법 procedure TForm1.StringGrid1GetEditText(Sender: TObject; ACol, ARow: Integer; var Value: string); begin // Set format for real numbers in column 2 if (ACol = 2) and TryStrToFloat(Value, Value) then Value := FormatFloat('#,##0.00', StrToFloat(Value)); end; 더보기
Stringgrid의 셀의 폰트와 정렬 Stringgrid의 셀에서 폰트와 가운데 정렬 등을 할 때 아래와 같은 코드를 사용한다. procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); var S: string; Grid: TStringGrid; Font: TFont; TextWidth: Integer; begin Grid := Sender as TStringGrid; // Get cell contents S := Grid.Cells[ACol, ARow]; // Create font Font := TFont.Create; Font.Size := 12; Font.Name := 'Arial'; if AR.. 더보기
HPF & LPF 가속도센서는 HPF를 사용하고 기울기 센서는 LFP를 사용한다. 1. HPF procedure HighPassFilter(var input, output: TArray; const freq, fs: Double); var i: Integer; RC, dt, alpha, y1: Double; begin // Calculate filter constants RC := 1 / (2 * PI * freq); dt := 1 / fs; alpha := RC / (RC + dt); // Apply filter to input signal y1 := input[0]; for i := 1 to High(input) do begin output[i] := alpha * (output[i-1] + input[i] - inp.. 더보기
Delphi 11.2 FireMonkey Low Code App Wizard - Error When using the FireMonkey Low Code App Wizard in Delphi version 11.2, the first attempt to compile results in an error. 델파이 11.2 버전에서 FireMonkey Low Code App Wizard를 사용할 때 처음 컴파일을 시도하면 에러가 발생한다. 1. E2250 There is no overloaded version of 'RequestPermissions' that can be called with these arguments -> TRequestPermissionsResultProc argument changed PermissionsService.RequestPermissions([JStringToS.. 더보기
Android Apps - Real-time streaming of IP camera images(안드로이드 앱 - IP 카메라 영상 실시간 스트리밍) 델파이로 윈도우, 안드로이드, ISO, 리룩스 등 멀티 플랫폼 개발을 지원한다. 하지만 나처럼 비 전공자에게는 넘어야 할 산이 많다. 이번에는 IP카메라를 안드로이드 폰에서 영상을 실시간으로 볼 수있는 앱을 개발하려고 한다. 요즘 대세인 ChatGPT 에게 물어보자 결론부터 말하면 안된다. (물론 나보다 능력이 좋은 사람은 어떻게든 수정해서 할 수 있을지 모르겠다.) 되는 방법만 보고 싶으면 아래 빨간 글씨부터 보면 된다. 더보기 나 : 델파이 안드로이드 IP카메라 연결 ChatGPT : 안드로이드 애플리케이션에서 IP 카메라에 연결하려면 일반적으로 다음 단계를 수행해야 합니다. IP 카메라의 IP 주소 및 포트 번호 확인 IP 카메라의 IP 주소 및 포트 번호를 알아야 안드로이드 애플리케이션에서 IP .. 더보기

반응형
LIST