user-interface

What is the data format read by the function cv2.imread? Working with tkinter and python

对着背影说爱祢 提交于 2021-01-28 05:02:01
问题 Good day, I am quite new to Python programming and I was tasked to do my own GUI with image inside my GUI. I have been doing some good progress but i was stuck when I want to insert an image into my GUI from my webcam. However, I did manage to get an image from the webcam but it has to be a different window with the GUI window. In my GUI codes, it includes a simple code like this: (I use range i<25 because my webcam needs warming up) for i in range (25): _ , frame = cap.read() frame = cv2

Kendo UI Excel export, generating multiple files, not refreshed properly?

本秂侑毒 提交于 2021-01-28 04:27:37
问题 I have a single page app, that often creates new data from an array var searchData = new kendo.data.DataSource({data: buildData}); and then displays it in a grid, this all looks good except the excel export missbehaves as follows: run one search and the excel export works fine. run a second search and the excel export downloads 2 files, the first being a repeat of the results of the first search, the second file being the new search. run a third search and the excel exports three files....

IntelliJ Idea GUI Forms: Null Layout

陌路散爱 提交于 2021-01-28 02:03:31
问题 Hey all, I'm migrating from Netbeans to IntelliJ. Now I'm trying to create a GUI form, and, unlike Netbeans, IntelliJ doesn't let you use a "Null Layout". Is there any way to put JComponents inside of a JFrame without using some wierd layout? Sorry if I'm using incorrect terminology--hope you understand my question :) 回答1: If you want null layout in IDEA (which is not recommended anyway), you can use the JFormDesigner. 来源: https://stackoverflow.com/questions/6092727/intellij-idea-gui-forms

How to convert JLabel.getIcon() to BufferedImage

大兔子大兔子 提交于 2021-01-28 01:35:03
问题 I have a JLabel that contains only an icon, and I can get the Icon with label1.getIcon(), but I can't figure out how to convert that Icon into a BufferedImage. Just FYI, I'm not talking about ImageIcon, only Icon. Also, I have seen the question at How to convert Icon from JLabel into BufferedImage?, but I can't seem to figure it out. As always, any examples or explanation are much appreciated. Thanks! 回答1: You may try this. // Get the icon Icon ico = label1.getIcon(); // Create a buffered

Android Dev: Run TimerTask in UI Thread

假装没事ソ 提交于 2021-01-28 01:27:22
问题 Im trying to update a TextView . This method is located in my Main Class and it is called in onCreate() ; I have tried using runOnUiThread() to no avail.. As soon as the 30 seconds is reached and it tries to update the TextView it crashes! Any help is appreciated: public void updateDisplay() { Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { Calendar c = Calendar.getInstance(); int mYear = c.get(Calendar.YEAR); int mMonth = c.get(Calendar.MONTH); int mDay = c

How to highlight only numbers and special characters inside Text in Flutter?

試著忘記壹切 提交于 2021-01-27 23:08:16
问题 I'm trying to highlight any numbers & special characters like '%' from a String that comes dynamically from JSON. This is my current implementation but I can't understand how to change it dynamically. RichText( overflow: TextOverflow.ellipsis, textAlign: TextAlign.center, maxLines: 4, text: TextSpan( children: <TextSpan>[ TextSpan( text: 'Hey I\'m', style: TextStyle( color: kDarkBlue, fontSize: 21)), TextSpan( text: '1234 ', style: TextStyle( fontWeight: FontWeight.w800, fontSize: 24)),

Browse an image file and display it in a kivy window

老子叫甜甜 提交于 2021-01-27 19:32:59
问题 I am a beginner in Kivy and trying to browse an image file using kivy fileChooser and then displaying it on the window. Bellow you find my code but it wouldn't do the task. It just displays '?PNG' on the console. Please, check this out with me ! import kivy from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.lang import Builder from kivy.uix.image import Image import os Builder.load_string(""" <MyWidget>: id: my_widget Button text: "open" on_release: my_widget.open

setSize() not working?

筅森魡賤 提交于 2021-01-27 18:29:10
问题 I have a program which takes two buttons, one that is regular and one that has a picture that changes depending on mouse roll over. Currently, since the picture is large, JButton custom is very large as well, can I change the size of custom and keep the image (and roll over image) proportionate? I have tried setSize, and it does't do anything. Any feedback would be appreciated! custom.setSize(50, 50); Here is all of my code: Main class: package Buttons; import javax.swing.JFrame; public class

Filling a JList with data

落爺英雄遲暮 提交于 2021-01-27 10:23:42
问题 Does anyone have any good tutorials on how to fill a JList (within a JPanel ) with user inputted data. Specifically, I want to add people to a selected roster. Is this a matter of filling it with an ArrayList ? Any help would be much appreciated. 回答1: create a ListModel which wrapps your java.util.List (e.g. by extending AbstractListModel) configure JList to use this model create and configure a renderer to format/ display the Objects in your list as needed http://docs.oracle.com/javase

Filling a JList with data

﹥>﹥吖頭↗ 提交于 2021-01-27 10:21:43
问题 Does anyone have any good tutorials on how to fill a JList (within a JPanel ) with user inputted data. Specifically, I want to add people to a selected roster. Is this a matter of filling it with an ArrayList ? Any help would be much appreciated. 回答1: create a ListModel which wrapps your java.util.List (e.g. by extending AbstractListModel) configure JList to use this model create and configure a renderer to format/ display the Objects in your list as needed http://docs.oracle.com/javase