MCPcopy Create free account
hub / github.com/Recordscript/recordscript / frame

Method frame

libs/scrap/src/dxgi/mag.rs:496–583  ·  view source on GitHub ↗
(&mut self, data: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

494 }
495
496 pub(crate) fn frame(&mut self, data: &mut Vec<u8>) -> Result<()> {
497 Self::clear_data();
498
499 unsafe {
500 let x = GetSystemMetrics(SM_XVIRTUALSCREEN);
501 let y = GetSystemMetrics(SM_YVIRTUALSCREEN);
502 let w = GetSystemMetrics(SM_CXVIRTUALSCREEN);
503 let h = GetSystemMetrics(SM_CYVIRTUALSCREEN);
504 if !(self.rect.left >= x as i32
505 && self.rect.top >= y as i32
506 && self.rect.right <= (x + w) as i32
507 && self.rect.bottom <= (y + h) as i32)
508 {
509 return Err(Error::new(
510 ErrorKind::Other,
511 format!(
512 "Failed Check screen rect ({}, {}, {} , {}) to ({}, {}, {}, {})",
513 self.rect.left,
514 self.rect.top,
515 self.rect.right,
516 self.rect.bottom,
517 x,
518 y,
519 x + w,
520 y + h
521 ),
522 ));
523 }
524
525 if FALSE
526 == SetWindowPos(
527 self.magnifier_window,
528 HWND_TOP,
529 self.rect.left,
530 self.rect.top,
531 self.rect.right - self.rect.left,
532 self.rect.bottom - self.rect.top,
533 0,
534 )
535 {
536 return Err(Error::new(
537 ErrorKind::Other,
538 format!(
539 "Failed SetWindowPos (x, y, w , h) - ({}, {}, {}, {}), error {}",
540 self.rect.left,
541 self.rect.top,
542 self.rect.right - self.rect.left,
543 self.rect.bottom - self.rect.top,
544 Error::last_os_error()
545 ),
546 ));
547 }
548
549 // on_gag_image_scaling_callback will be called and fill in the
550 // frame before set_window_source_func_ returns.
551 if let Some(set_window_source_func) = self.mag_interface.set_window_source_func {
552 if FALSE == set_window_source_func(self.magnifier_window, self.rect) {
553 return Err(Error::new(

Callers 1

testFunction · 0.45

Calls

no outgoing calls

Tested by 1

testFunction · 0.36