rectangles

Bounding Box from VNDetectRectangleRequest is not correct size when used as child VC

帅比萌擦擦* 提交于 2021-02-15 07:08:28
问题 I am trying to use VNDetectRectangleRequest from Apple's Vision framework to automatically grab a picture of a card. However when I convert the points to draw the rectangle, it is misshapen and does not follow the rectangle is it should. I have been following this article pretty closely One major difference is I am embedding my CameraCaptureVC in another ViewController so that the card will be scanned only when it is in this smaller window. Below is how I set up the camera vc in the parent vc

Bounding Box from VNDetectRectangleRequest is not correct size when used as child VC

夙愿已清 提交于 2021-02-15 07:05:26
问题 I am trying to use VNDetectRectangleRequest from Apple's Vision framework to automatically grab a picture of a card. However when I convert the points to draw the rectangle, it is misshapen and does not follow the rectangle is it should. I have been following this article pretty closely One major difference is I am embedding my CameraCaptureVC in another ViewController so that the card will be scanned only when it is in this smaller window. Below is how I set up the camera vc in the parent vc

How to add a border to a rectangle in Java using setBorder and JFrame

戏子无情 提交于 2021-02-05 07:15:05
问题 I am trying to add a border to a Rectangle element and for some reason it will not work, is it not compatible with JFrame ? I can set my entire JFrame to having a border, but it can't find setBorder with my rectangles. Here is my code: package trivia; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Rectangle; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.border

Why is nothing drawn in PyGame at all?

淺唱寂寞╮ 提交于 2021-01-29 21:05:43
问题 i have started a new project in python using pygame and for the background i want the bottom half filled with gray and the top black. i have used rect drawing in projects before but for some reason it seems to be broken? i don't know what i am doing wrong. the weirdest thing is that the result is different every time i run the program. sometimes there is only a black screen and sometimes a gray rectangle covers part of the screen, but never half of the screen. import pygame, sys from pygame

Pygame Drawing a Rectangle

心已入冬 提交于 2020-12-02 06:05:06
问题 Im making a game that requires knowing how to draw a rectangle in python 3.2. I have checked lot of sources but none show exactly how to do it. Thanks! 回答1: import pygame, sys from pygame.locals import * def main(): pygame.init() DISPLAY=pygame.display.set_mode((500,400),0,32) WHITE=(255,255,255) BLUE=(0,0,255) DISPLAY.fill(WHITE) pygame.draw.rect(DISPLAY,BLUE,(200,150,100,50)) while True: for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit() pygame.display.update()

Pygame Drawing a Rectangle

早过忘川 提交于 2020-12-02 06:00:48
问题 Im making a game that requires knowing how to draw a rectangle in python 3.2. I have checked lot of sources but none show exactly how to do it. Thanks! 回答1: import pygame, sys from pygame.locals import * def main(): pygame.init() DISPLAY=pygame.display.set_mode((500,400),0,32) WHITE=(255,255,255) BLUE=(0,0,255) DISPLAY.fill(WHITE) pygame.draw.rect(DISPLAY,BLUE,(200,150,100,50)) while True: for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit() pygame.display.update()

Pygame Drawing a Rectangle

拟墨画扇 提交于 2020-12-02 06:00:22
问题 Im making a game that requires knowing how to draw a rectangle in python 3.2. I have checked lot of sources but none show exactly how to do it. Thanks! 回答1: import pygame, sys from pygame.locals import * def main(): pygame.init() DISPLAY=pygame.display.set_mode((500,400),0,32) WHITE=(255,255,255) BLUE=(0,0,255) DISPLAY.fill(WHITE) pygame.draw.rect(DISPLAY,BLUE,(200,150,100,50)) while True: for event in pygame.event.get(): if event.type==QUIT: pygame.quit() sys.exit() pygame.display.update()

Fitting equal rectangles into larger rectangle

天大地大妈咪最大 提交于 2020-07-18 05:57:08
问题 I have a single large rectangle of dimensions L*W , and n smaller rectangles that each have the same dimension l * w . Every small rectangle has the same dimensions . My goal is to fit all n of smaller rectangles into the large rectangle while making the most efficient use of space in the large rectangle possible. l and w can be scaled up or down as needed, as long as the proportion is kept the same. How can it be determined how the smaller rectangles should be scaled to fit them all in the