|
MainForm->AlarmImage->Picture->Bitmap->PixelFormat = pf16bit;
MainForm->AlarmImage->Transparent = true;
이렇게 추가시키고 간단한 테스트 작업을 했었는데.. 32bit 로 디스플레이 모드가 변경되어도 흰 바탕이 생기지 않네요.
선이 화면 바깥쪽으로 나가는 건 잘 모르겠네요. 이미지 객체에서 선을 그리면, 아무리 값을 벗어나도 이미지 객체 바깥쪽으로 나가지는 않거든요. 이미지 객체가 그리시려는 영역보다 큰 것이 아닌가요..?
아래 코드를 직접 제가 실행을 시킬 수 있는 입장이 아니라서, 어디가 문제인 것이라고 찝어 드리기가 곤란하네요. 죄송합니다..
blueSea 님이 쓰신 글 :
: 유영인.Chris 님이 쓰신 글 :
: : DrawAlarmAgain 을 호출 하실 때, 라인 색은 어떻게 값을 넘겨 주셨나요?
: :
: : 문제가 계속 된다면, 간단한 테스트 프로그램을 만들어서 테스트를 해 보시는 것이 좋을 것 같습니다.
: :
: : 그리고, 투명 바탕에 선등만 그릴 때는, 이미지의 Transparent 프로퍼티를 True 로 해주시는 것이 좋습니다.
: :
: :
: 답변 감사합니다. 계속 질문만 드리네요...
:
: 함수를 호출할때는 아래와 같은 식으로 호출을 합니다.
: DrawAlarmAgain( FaCheckListBox->ItemIndex,
: FaSelect, clBlack, clYellow, clYellow);
: 그리고 그 함수에서 모든 부분을 제외하고
:
: void __fastcall TConfigForm::DrawAlarmAgain(int index, unsigned char* MyArray, TColor Color1, TColor Color2, TColor Color3)
: {
: //TODO: Add your source code here
: TStringGrid *strGrid = FaAlarmStringGrid;
: float start = 0, end = 0, level_hi = 0, level_lo = 0;
: float DrawStart = 0, DrawEnd = 0;
: float minf = MainForm->LfLBVal->Caption.ToDouble();
:
: // MainForm->AlarmImage->Picture->Bitmap->PixelFormat = pf16bit;
: MainForm->AlarmImage->Transparent = true;
: TCanvas *Canvas = MainForm->AlarmImage->Canvas;
: Canvas->Brush->Color = clBlack;
: Canvas->Brush->Color = Color1;
: Canvas->Pen->Color = Color2;
:
: Canvas->MoveTo(40, 200);
: Canvas->LineTo(50, 200);
:
: #if 0
: if( MainForm->SpurRBT->Checked)
: {
: if(MyArray[index] == 0x01)
: {
:
: start = StrToFloat(strGrid->Cells[1][index+1]);
: end = StrToFloat(strGrid->Cells[2][index+1]);
: level_hi = StrToFloat(strGrid->Cells[3][index+1]);
: level_lo = StrToFloat(strGrid->Cells[4][index+1]);
:
: DrawStart = start - minf;
: DrawEnd = end - minf;
: StartX[index] = DrawStart * IMG_WIDTH/(MainForm->SpanTrans);
: EndX[index] = DrawEnd * IMG_WIDTH/(MainForm->SpanTrans);
: LevelHigh[index] = MainForm->AlarmImage->Height
: * 0.01 * (MainForm->RefTrans - level_hi);
: LevelLow[index] = MainForm->AlarmImage->Height
: * 0.01 * (MainForm->RefTrans - level_lo);
:
: Canvas->MoveTo(StartX[index], LevelHigh[index]);
: Canvas->LineTo(EndX[index], LevelHigh[index]);
:
: // Canvas->MoveTo(40, 200);
: // Canvas->LineTo(50, 220);
:
:
: Canvas->Pen->Color = Color3;
:
: Canvas->MoveTo(StartX[index], LevelLow[index]);
: Canvas->LineTo(EndX[index], LevelLow[index]);
:
:
: }
: else
: {
: Canvas->Pen->Color = Color1;
: Canvas->MoveTo(StartX[index], LevelHigh[index]);
: Canvas->LineTo(EndX[index], LevelHigh[index]);
: Canvas->MoveTo(StartX[index], LevelLow[index]);
: Canvas->LineTo(EndX[index], LevelLow[index]);
: }
:
: Canvas->Pen->Color = Color2;
: }
: #endif
:
: }
:
: 이렇게만 사용하면 화면에 이상없이 그려집니다.
: 화면에 라인을 그릴때 화면 밖에다 라인을 긋는 경우가 생기는데 이것때문에 문제가
: 될까요? 그래도 24bit로 놓고 하면 문제 없이 되는데......
:
|