graphics

How can I merge two images into one?

China☆狼群 提交于 2019-12-13 18:32:14
问题 I have a mask image with opacity about 70%, and I have another image that is downloaded from server. How can I redraw them to single image that have the downloaded image lay right below the mask image? I don't want to use canvas because I will use the merge image for panorama background, and canvas wouldn't work. Something like this: using (Graphics grfx = Graphics.FromImage(image)) { grfx.DrawImage(newImage, x, y) } I tried this but no luck: BitmapImage bmp = new BitmapImage(); BitmapImage

Why doesn't the Inset item show in Prolog in a plot?

让人想犯罪 __ 提交于 2019-12-13 18:12:34
问题 I apologise for the length of this question. My current Mathematica programming project involves replicating the very specific business rules my employing institution has for publication-quality plots of time series. One of these rules is that multipanel graphs have panel titles and subtitles centered near the top of the plot area. This worked fine using Prolog and Inset until I redid that bit of the function to allow explicit Prolog elements to be included as well. Then only the item passed

How to rotate a graphic over global axes, and not to local axes?

拜拜、爱过 提交于 2019-12-13 18:01:23
问题 I think my problem is very simple, but I´m new in Opengl and I don't know what to do. I'm trying to rotate a pyramid (the figure doesn't matter), I want to rotate with respect to X and then rotate with respect to Y axe. But when I do a rotation on X, the Y axe rotates too. And then when I want to rotate whit respect to Y, Y axis is no longer the original. The next image shows how mi pyramid stars in the origin: Then rotate winth respect to X: The axes Y and Z rotate too, and then if I want to

Brick Breaker help. circles, paddles, and awkward bouncing

流过昼夜 提交于 2019-12-13 17:45:49
问题 I've written a simple brick breaker game in OpenGL. The ball is a 2D circle drawn using : for (float angle = 0; angle < (10); angle+=0.01) { glVertex2f((x_pos + sin(angle) * RADIUS), (y_pos + (cos(angle)) * RADIUS)); } This causes distortion when the game is changed to fullscreen. RADIUS is defined as 0.025 . I need help in making the paddle movements smooth as well. Also, if you play the game a couple of times, you'll notice that towards the extreme left, when the ball hits the paddle, it

How to make an horizontal box-and-whiskers plot in gnuplot

时间秒杀一切 提交于 2019-12-13 17:06:42
问题 How do you make an horizontal box-and-whiskers plot in gnuplot? Similarly to this one: Gnuplot can easily be used to produce vertical box-and-whiskers plots with the 'candlesticks' and 'whiskerbars' keywords, but I have not managed to find any example of an horizontal candlesticks/box-and-whiskers horizontal plot produced via gnuplot online. Example of a vertical plot produced by gnuplot: example of a vertical box-and-whiskers plot http://www.cise.ufl.edu/~dts/cop3530/proj02/candlesticks.6

Avoiding <matplotlib.figure.Figure at 0xeafea58>

谁说胖子不能爱 提交于 2019-12-13 16:18:34
问题 I am trying to plot a series of functions on the same graphs. The code seems to run ok, but there is no picture coming coming out. just simply <matplotlib.figure.Figure at 0xeafea58> How can it be fixed? 回答1: In the IPython console, the best way to make sure figures show up (without explicitly calling plt.show() ) is to use %matplotlib mode. If matplotlib is installed correctly, it should automatically choose a suitable backend for your system. For example: In [1]: import matplotlib.pyplot as

Create depth map from 3d points

徘徊边缘 提交于 2019-12-13 16:12:41
问题 I have given 3d points of a scene or a subset of these points comprising one object of the scene. I would like to create a depth image from these points, that is the pixel value in the image encodes the distance of the corresponding 3d point to the camera. I have found the following similar question http://www.mathworks.in/matlabcentral/newsreader/view_thread/319097 however the answers there do not help me, since I want to use MATLAB. To get the image values is not difficult (e.g. simply

Linux basic graphics programming without OpenGL

社会主义新天地 提交于 2019-12-13 15:47:05
问题 What are the good choices to start basic graphics programming in C/C++ (both 2D and 3D) for a learner? I want to try out things given in the book (3D math primer). Obviously I don't want to use OpenGL. I have a machine that has Linux (Debian). What are my choices on Linux to start with? QT or GTK or something else? Edit: I don't want to use OpenGL because it does most of the interesting work for me. Like, rotation, projection etc. I want to learn those things. 回答1: Use OpenGL. You can either

OpenCL on Linux with integrated intel graphic chip

ε祈祈猫儿з 提交于 2019-12-13 15:22:56
问题 I would like to use OpenCL on debian 8. I read on this page that Intel's GPUs are not supported on linux. (The article is from 2011, so I hope it is out of date.) I already installed OpenCL nontheless and can run compile and run the code found here. As to my hardware. My processor is Intel(R) Core(TM) i7-4500 CPU @ 1.80GHz lspci | grep VGA outputs 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09) So to clearify: I want to know, if it is

Simply Java Button to Display a Circle

我怕爱的太早我们不能终老 提交于 2019-12-13 15:12:26
问题 I am currently learning java, I understand the concepts except Graphics which as a programmer is totally new to me. Quite frankly it is driving my around the bend. My example should in theory make a circle appear at the press of a Button. Using print methods to debug I keep finding that the Button correctly called all the methods and creates a new circle c object but in the newNode().drawCircle() repaint() is never called and hence the new object not drawn. WHY IS THIS and can someone help me