BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / cpp / #85501同步于 2015/1/28
CPP机器人发帖

请教一个C++的问题

wei866
2015/1/28镜像同步0 回复
void CHardwareSimulation:: FakeHardware ( ) { m_InterruptTime++; // // The hardware can be in a pause state in which case, it issues interrupts // but does not complete mappings. In this case, don't bother synthesizing // a frame and doing the work of looking through the mappings table. // if (m_HardwareState == HardwareRunning) { // // Generate a "time stamp" just to overlay it onto the capture image. // It makes it more exciting than bars that do nothing. // LONGLONG PtsRel = ((m_InterruptTime + 1) * m_TimePerFrame); ULONG Min = (ULONG)(PtsRel / 600000000); ULONG RemMin = (ULONG)(PtsRel % 600000000); ULONG Sec = (ULONG)(RemMin / 10000000); ULONG RemSec = (ULONG)(RemMin % 10000000); ULONG Hund = (ULONG)(RemSec / 100000); // // Synthesize a buffer in scratch space. // m_ImageSynth -> SynthesizeBars (); CHAR Text [256]; Text[0] = '\0'; (void) RtlStringCbPrintfA(Text, sizeof(Text), "%ld:%02ld.%02ld", Min, Sec, Hund); // // Overlay a clock onto the scratch space image. // m_ImageSynth -> OverlayText ( POSITION_CENTER, (m_Height - 28), 1, Text, BLACK, WHITE ); // // Overlay a counter of skipped frames onto the scratch image. // (void) RtlStringCbPrintfA(Text, sizeof(Text), "Tarique Skipped: %ld", m_NumFramesSkipped); m_ImageSynth -> OverlayText ( 10, 10, 1, Text, TRANSPARENT, BLUE ); // // Fill scatter gather buffers // if (!NT_SUCCESS (FillScatterGatherBuffers ())) { InterlockedIncrement (PLONG (&m_NumFramesSkipped)); } } // // Issue an interrupt to our hardware sink. This is a "fake" interrupt. // It will occur at DISPATCH_LEVEL. // m_HardwareSink -> Interrupt (); // // Reschedule the timer if the hardware isn't being stopped. // if (!m_StopHardware) { // // Reschedule the timer for the next interrupt time. // LARGE_INTEGER NextTime; NextTime.QuadPart = m_StartTime.QuadPart + (m_TimePerFrame * (m_InterruptTime + 1)); KeSetTimer (&m_IsrTimer, NextTime, &m_IsrFakeDpc); } else { // // If someone is waiting on the hardware to stop, raise the stop // event and clear the flag. // m_StopHardware = FALSE; KeSetEvent (&m_HardwareEvent, IO_NO_INCREMENT, FALSE); } } 想将timer换成一张rgb的图片,请问该怎么做啊?
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。