|
팔레트 정보나 초기 비트맵 비트가 맞지 않아서 그럴지도 모르겠네요.
Image1->Picture->Bitmap->PixelFormat = pf16bit;
이런 식으로 비트를 설정해 보시는건 어떻까요?
blueSea 님이 쓰신 글 :
: 안녕하세요.
: 항상 도움만 받는 초보입니다.
: 내가 만든 프로그램은 윈도우 색이 24bit로 설정해 놓은 상태에서 만들어 졌는데..
: 이것을 32bit로 설정되어 있는 윈도우에서 문제가 생깁니다.
:
: 문제가 되는 부분의 코드는 아래입니다.
:
: 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();
:
: TCanvas *Canvas = MainForm->AlarmImage->Canvas;
: Canvas->Brush->Color = clBackground;
: Canvas->Brush->Color = Color1;
: Canvas->Pen->Color = Color2;
:
:
: 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;
: }
:
: }
:
: 위처럼 되어 있는 코드를 실행하면
: 24bit일때는 제대로 image에 라인이 나타납니다.
: 32bit일때는 처음엔 image에 라인이 나타나면서 전체 화면이 백색이 됩니다.그리고 그림을 지운 다음 다시 이벤트를 주게 되면 제대로 나옵니다.
: 원인을 모르겠습니다. 빨리 해결해야 되는데... 도움 주시면 감사하겠습니다.
|