rect

How can I get screenshot from all displays on MAC?

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I try to get the screenshot from all monitors connected with my MAC to one picture. I know, how I can do this if every monitor's screenshot will saved to different pictures, but it is not what I want. I found function CGGetDisplaysWithRect , but my solution don't work, because output picture is empty. I expect, that problem with function CGDisplayCreateImageForRect (*displays, rect), because first parameter must be CGDirectDisplayID type, but not CGDirectDisplayID*. But I can't find function, which can create one picture with some

iPhone development: pointer being freed was not allocated

匿名 (未验证) 提交于 2019-12-03 02:27:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i got this message from the debugger: Pixture(1257,0xa0610500) malloc: *** error for object 0x21a8000: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug so i did a bit of tracing and got: (gdb) shell malloc_history 1257 0x21a8000 ALLOC 0x2196a00-0x21a89ff [size=73728]: thread_a0610500 |start | main | UIApplicationMain | GSEventRun | GSEventRunModal | CFRunLoopRunInMode | CFRunLoopRunSpecific | __CFRunLoopDoObservers | CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) | CA:

What is the best way to convert from a RectF to a Rect in Android?

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to convert from a RectF to a Rect in Android. Currently I have: RectF rectF = new RectF(); rectF.set( ... some values ... ); ... Rect rect = new Rect((int)rectF.left, (int)rectF.top, (int)rectF.right, (int)rectF.bottom)); Is there a better way? 回答1: Ah ha -- found the answer: rectF.round(rect); -- or -- rectF.roundOut(rect); 文章来源: What is the best way to convert from a RectF to a Rect in Android?

java.lang.IllegalArgumentException: Rect should intersect with child's bounds

匿名 (未验证) 提交于 2019-12-03 02:16:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In Android Studio after starting a new project, and selecting a Tabbed Activity, after the project is build, I get this error in the Android Monitor: E / AndroidRuntime : FATAL EXCEPTION : main Process : com . example . app , PID : 23581 java . lang . IllegalArgumentException : Rect should intersect with child 's bounds. at android.support.design.widget.CoordinatorLayout.offsetChildByInset(CoordinatorLayout.java:1319) at android.support.design.widget.CoordinatorLayout.onChildViewsChanged(CoordinatorLayout.java:1257) at android

Android Center text on canvas

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to display a text using the code below. The problem is that the text is not centered horizontally. When I set the coordinates for drawText , it sets the bottom of the text at this position. I would like the text to be drawn so that the text is centered also horizontally. This is a picture to display my problem further: @Override protected void onDraw(Canvas canvas) { // TODO Auto-generated method stub super.onDraw(canvas); //canvas.drawRGB(2, 2, 200); Paint textPaint = new Paint(); textPaint.setARGB(200, 254, 0, 0); textPaint

How to align multiple ggplot2 plots and add shadows over all of them

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Please download the data here! Target: Plot an image like this: Features: 1. two different time series; 2. the lower panel has a reverse y-axis; 3. shadows over two plots. Possible solutions: 1. Facetting is not appropriate - (1) can not just make one facet's y axis reverse while keep the other(s) unchanges. (2) difficult to adjust the individual facets one by one. 2. Using viewports to arrange individual plots using the following codes: library(ggplot2) library(grid) library(gridExtra) ##Import data df<- read.csv("D:\\R\\SF_Question.csv") #

Add scrolling to a platformer in pygame

匿名 (未验证) 提交于 2019-12-03 02:10:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Ok so I included the code for my project below, I'm just doing some experimenting with pygame on making a platformer. I'm trying to figure out how to do some very simple scrolling that follows the player, so the player is the center of the camera and it bounces/follows him. Can anyone help me? import pygame from pygame import * WIN_WIDTH = 800 WIN_HEIGHT = 640 HALF_WIDTH = int(WIN_WIDTH / 2) HALF_HEIGHT = int(WIN_HEIGHT / 2) DISPLAY = (WIN_WIDTH, WIN_HEIGHT) DEPTH = 32 FLAGS = 0 CAMERA_SLACK = 30 def main(): global cameraX, cameraY pygame

Capture screen of Window by handle

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to capture only a specific Window in the desktop but I'm getting a mixed image, part of window and part desktop area. What am I missing? Here's my code: RECT rect = new RECT(); if (!SetForegroundWindow(handle)) throw new Win32Exception(Marshal.GetLastWin32Error()); if (!GetWindowRect(handle, out rect)) throw new Win32Exception(Marshal.GetLastWin32Error()); Thread.Sleep(500); Rectangle windowSize = rect.ToRectangle(); Bitmap target = new Bitmap(windowSize.Width, windowSize.Height); using (Graphics g = Graphics.FromImage(target)) {

reprojectImageTo3D() in OpenCV

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I've been trying to compute real world coordinates of points from a disparity map using the reprojectImageTo3D() function provided by OpenCV, but the output seems to be incorrect. I have the calibration parameters, and compute the Q matrix using stereoRectify(left_cam_matrix, left_dist_coeffs, right_cam_matrix, right_dist_coeffs, frame_size, stereo_params.R, stereo_params.T, R1, R2, P1, P2, Q, CALIB_ZERO_DISPARITY, 0, frame_size, 0, 0); I believe this first step is correct, since the stereo frames are being rectified properly, and

Android camera2 face recognition

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: There is not enough info about camera2 face recognition mechanism. I used Camera2 sample from Google: android-Camera2Basic I set face recognition mode to FULL. mPreviewRequestBuilder.set(CaptureRequest.STATISTICS_FACE_DETECT_MODE, CameraMetadata.STATISTICS_FACE_DETECT_MODE_FULL); Also I checked STATISTICS_INFO_MAX_FACE_COUNT and STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES : int max_count = characteristics.get( CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT); int modes [] = characteristics.get( CameraCharacteristics.STATISTICS_INFO