graphics

Graphics mode in assembly 8086

谁说胖子不能爱 提交于 2019-12-28 04:17:44
问题 I have a variable that is called average and in my DATASEG , it changes every time because the user enters a different input every time. What I want to do is to go to the graphics mode (VGA) and then print there Your average is: and then the average I know how to change to the graphics mode like this: mov ax, 13h int 10h After printing the average I want to print below if the average is above 75 You are a good student, keep up the good work and if not. Don't worry you will get better! Thanks

Java2D: Increase the line width

萝らか妹 提交于 2019-12-28 03:31:06
问题 I want to increase the Line2D width. I could not find any method to do that. Do I need to actually make a small rectangle for this purpose? 回答1: You should use setStroke to set a stroke of the Graphics2D object. The example at http://www.java2s.com gives you some code examples. The following code produces the image below: import java.awt.*; import java.awt.geom.Line2D; import javax.swing.*; public class FrameTest { public static void main(String[] args) { JFrame jf = new JFrame("Demo");

Remove facet_wrap labels completely

社会主义新天地 提交于 2019-12-28 03:29:52
问题 I'd like to remove the labels for the facets completely to create a sort of sparkline effect, as for the audience the labels are irrelevant, the best I can come up with is: library(MASS) library(ggplot2) qplot(week,y,data=bacteria,group=ID, geom=c('point','line'), xlab='', ylab='') + facet_wrap(~ID) + theme(strip.text.x = element_text(size=0)) So can I get rid of the (now blank) strip.background completely to allow more space for the "sparklines"? Or alternatively is there a better way to get

Java AWT/SWT/Swing: How to plan a GUI?

£可爱£侵袭症+ 提交于 2019-12-28 03:18:05
问题 I've already realized some applications with a small graphical user interface. Nothing complex, but I've encountered several problems that components aren't displayed or just not behaving as expected. Now my question: How do you plan those user interfaces? What do you do when you need to make changes? How do you debug strange behaviours?! This applies for nearly every type of gui-design. Sure, with Microsofts Visual Studio you have a big advantage because you nearly get what you see in the

How do I make a rectangle move across the screen with key bindings?

北慕城南 提交于 2019-12-28 03:12:18
问题 The game I'm trying to create is snake and so far I've figured out how to use paint(Graphics g) a bit of JPanel , mouse listener and now I'm trying to create a rectangle that will move across the screen and use key bindings or key listener, but I have no idea how I should go about this. Here's my code so far, it has 2 parts. The first part is called snake2 because if I don't know what I'm doing I make the same program with different things. Snake used frame, but Snake2 uses JPanel (looks

Scaling/Translating a Shape to a given Rectangle using AffineTransform

夙愿已清 提交于 2019-12-28 03:10:54
问题 I'm trying to scale/translate a java.awt. Shape with AffineTransform in order to draw it in a defined bounding Rectangle. Moreover, I want to paint it in a drawing Area having a ' zoom ' parameter. I tried various concatenations of AffineTransform but I couldn't find the correct sequence. For example, the following solution was wrong: double zoom=(...);/* current zoom */ Rectangle2D viewRect=(...)/** the rectangle where we want to paint the shape */ Shape shape=(...)/* the original shape that

Android — How to allow horizontal and vertical scrolling

喜欢而已 提交于 2019-12-28 03:02:30
问题 There is the ScrollView that allows only vertical scrolling, and the HorizontalScrollView that allows only horizontal scrolling, but no class for both. This seems like a pretty gaping deficit in the Android UI. Any tricks to allow this? 回答1: Try this <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <HorizontalScrollView xmlns:android="http://schemas.android.com

Why doesn't hue rotation by +180deg and -180deg yield the original color?

痞子三分冷 提交于 2019-12-28 02:50:06
问题 By reading HSL/HSV color theory, I get the impression that hue component is a cyclical attribute that repeats every 360 degrees and can be changed independently of saturation and lightness/value. Correct me if I am wrong, but these statements logically follow the previous definition: Rotating hue by 360 degrees yields the same color Rotating hue by 180 degrees twice yields the original color Rotating hue by 180 degrees followed by -180 degrees yields the original color However, only the

Real time plot in MATLAB

。_饼干妹妹 提交于 2019-12-28 02:39:08
问题 I'm very new to MATLAB and I was trying to display a real time plot of some calculations. I have an N sized vector and I work with m values at a time (say m = N/4 ), so I want to plot the first m values and then as soon as the second m values are calculated have them replace the first plot. My approach was as follows: for i=1:N, ... //compute m ... plot(m); end; but it fails to update the plot in every loop and waits for all the loops to finish to plot the data. My question is: Should I use

Drawing 3D sphere in C/C++

时间秒杀一切 提交于 2019-12-28 02:13:37
问题 I am looking for an algorithm which can draw a nice looking 3D sphere on small resolution. I found Bresenham's circle algorithm but it's for 2D drawing. I just need spheres borders (I don't need it filled). I also googled for a solution of the problem but I didn't find anything. This article doesn't help (what is the brute force algorithm?). I can't use any OpenGL libraries, I need vanilla C/C++ solution. Thank you in advance. 回答1: if I get it right you want to render all surface Voxels of