📄 ref.txt
字号:
MdigGrab(MilDigitizerId, MilImageBufferId);
MdigGrabWait(MilDigitizerId, M_GRAB_END);
MgraColor(M_DEFAULT, 130L);
MgraArcFill(M_DEFAULT, MilImageBufferId, 256L, 240L, 100L, 100L, 0.0, 360.0);
// Draw GDI color overlay annotation *
//************************************
// Create a device context to draw in the overlay buffer with GDI.
MbufControl(MilOverlayImage, M_WINDOW_DC_ALLOC, M_DEFAULT);
// Attach the device context.
CDC NewDC;
NewDC.Attach((HDC)MbufInquire(MilOverlayImage, M_WINDOW_DC, M_NULL));
// Create a blue pen.
hpen.CreatePen(PS_SOLID, 1, RGB(0, 0, 255));
hpenOld = NewDC.SelectObject(&hpen);
// Draw a cross in the overlay buffer.
NewDC.MoveTo(0,ImageHeight/2);
NewDC.LineTo(ImageWidth,ImageHeight/2);
NewDC.MoveTo(ImageWidth/2,0);
NewDC.LineTo(ImageWidth/2,ImageHeight);
// Write text in the overlay buffer.
strcpy(chText, "GDI Overlay Text ");
NewDC.SetTextColor(RGB(0, 0, 255));
NewDC.TextOut(ImageWidth*3/18,ImageHeight*4/6, chText, strlen(chText));
NewDC.SetTextColor(RGB(255, 0, 0));
NewDC.TextOut(ImageWidth*12/18,ImageHeight*4/6, chText, strlen(chText));
// Deselect and destroy the blue pen.
NewDC.SelectObject(hpenOld);
hpen.DeleteObject();
// Detach the device context.
NewDC.Detach();
// Delete created device context.
MbufControl(MilOverlayImage, M_WINDOW_DC_FREE, M_DEFAULT);
// Overlay is now initialized
fOverlayIsInitialized = TRUE;
}
}
// LUT data for PSEUDO-COLOR: R G B Entry: Color: */
static unsigned char LutLow[30] = { 0, 0, 0, // Index 0 = black
128, 0, 0, // Index 1 = dark-red
0, 128, 0, // Index 2 = dark-green
128, 128, 0, // Index 3 = dark-yellow
0, 0, 128, // Index 4 = dark-blue
128, 0, 128, // Index 5 = dark-magenta
0, 128, 128, // Index 6 = dark-cyan
192, 192, 192, // Index 7 = bright-grey
192, 220, 192, // Index 8 = lite-green
166, 202, 240 // Index 9 = lite-blue
};
static unsigned char LutHigh[30] = { 255, 251, 240, // Index 246 = lite-white
160, 160, 164, // Index 247 5 lite-grey
128, 128, 128, // Index 248 = dark-grey
255, 0, 0, // Index 249 = red
0, 255, 0, // Index 250 = green
255, 255, 0, // Index 251 = yellow
0, 0, 255, // Index 252 = blue
255, 0, 255, // Index 253 = magenta
0, 255, 255, // Index 254 = cyan
255, 255, 255 // Index 255 = white
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -