graphics

iPhone + Quartz: How to get a water effect

风格不统一 提交于 2019-12-19 04:56:17
问题 ist there any chance to build a water effect with Quartz on the iPhone? Something similar to this one: alt text http://img37.imageshack.us/img37/6358/bild1wbm.png 回答1: For that, I highly recommend using OpenGL ES . Despite the "simplicity" of the problem you addressed in this SO question, I recommended OpenGL ES then as well. So, you can imagine why I'm advising it again. Check this SO question for the water effect with OpenGL. 来源: https://stackoverflow.com/questions/927714/iphone-quartz-how

Best way to animate in Java?

家住魔仙堡 提交于 2019-12-19 04:23:21
问题 I'm currently using an animation engine I designed that takes objects of type Drawable and adds them to a List. Drawable is an interface that has one method: public void draw(Graphics2D g2d); The extending animation manager iterates through this list and calls the draw() method on every object, passing the Graphics2D object obtained from the Swing component. This method seemed to work well at first, but as I feared, it seems to be unable to handle multiple objects in the long run. With merely

Desktop graphics - or “skinned” windows

℡╲_俬逩灬. 提交于 2019-12-19 04:09:53
问题 I'm looking for a way to draw animations right on the desktop. No window frames and with transparent background. I'm using Python in windows XP for it, but it doesn't have to be cross platform, although it'd be a nice bonus. Does anyone know about a python library that can do this? 回答1: If you want a frameless window, there are several options. For example, pygame can be initialized with the following flag: pygame.init() screen = pygame.display.set_mode(size=(640,480), pygame.NOFRAME) Your

JfreeChart: Scroll XYBarChart Horizontally - (chart translation and navigation)

我怕爱的太早我们不能终老 提交于 2019-12-19 04:07:28
问题 I am trying to scroll my XYBarChart horizontally, I am following one of the JfreeChart's Demo "TranslateDemo1.java" in which the source code you can find here: http://code.google.com/p/cori-chenxx/source/browse/aliper/trunk/aliper-core/src/test/java/com/alibaba/aliper/TranslateDemo1.java?spec=svn148&r=148 The source code works fine for a "TimeSeriesChart". However I tried with "XYBarChart" and WHEN I SLIDE THE BAR the behavior is not the same. Just to be clear I replaced the line #157 with

Large images with Direct2D

别说谁变了你拦得住时间么 提交于 2019-12-19 03:59:30
问题 Currently I am developing application for the Windows Store which does real time-image processing using Direct2D. It must support various sizes of images. The first problem I have faced is how to handle the situations when the image is larger than the maximum supported texture size. After some research and documentation reading I found the VirtualSurfaceImageSource as a solution. The idea was to load the image as IWICBitmap then to create render target with CreateWICBitmapRenderTarget (which

Why does this image look so bad after being scaled down in Java?

扶醉桌前 提交于 2019-12-19 03:24:26
问题 Here is the original image: http://rank.my/public/images/uploaded/orig-4193395691714613396.png And here it is scaled down to 300x225: http://rank.my/public/images/uploaded/norm-4193395691714613396.png And here it is scaled down to 150x112: http://rank.my/public/images/uploaded/small-4193395691714613396.png As you can see, 300x225 looks pretty bad, and 150x112 looks awful. Here is the code I'm using to scale down the image: private static BufferedImage createResizedCopy(final BufferedImage

Calculate the horizon of a curved face? - Not extrema

霸气de小男生 提交于 2019-12-19 03:21:07
问题 I need to find the 2 points of the visual horizon , of a curved face. I have: XYZ of the 4 corner points XYZ of the 2 curved edge bezier points And I need to calculate either: XY of the 2 horizon points XYZ of the 2 horizon points Note: I got a solution the last time I asked this question, but it only found the extrema of the curves, not the horizon points , which changes based on the position and rotation of both curves in respect to each other. 回答1: You don't say how your surface is defined

Android: Drawing to canvas, way to make bottom left correspond to (0,0)?

不打扰是莪最后的温柔 提交于 2019-12-19 03:09:37
问题 I'm trying to write a graph class I can use in Android(I'm aware pre-made ones exist), but converting all of my coordinates would be a pain. Is there an easy way to make the screen coordinates start at the bottom left? 回答1: No, I don't know of a way to move 0,0 to the bottom left and get what you would typically think of as "normal" coordinates. But combining scale() and translate() might do the trick to achieve the same effect. canvas.translate(0,canvas.getHeight()); // reset where 0,0 is

Missing half of first pixel column after a Graphics Transform Scale

故事扮演 提交于 2019-12-19 02:04:10
问题 I have noticed that the half of the first pixel column of the image is not drawn after a Graphics Transform Scale on the OnPaint event. All the code needed to reproduce it is at the end of the post. Basically I've created a Class derived from PictureBox called PictureBox2 and it overrides the OnPaint method to perform the Scale transformation. It also changes the InterpolationMode to NearestNeighbor to prevent Graphics from changing the pixels look. The PictureBox control was added to a Form

Making A Graphic Pie Chart In C#

℡╲_俬逩灬. 提交于 2019-12-19 01:23:12
问题 I'm trying to write a Windows Application that shows a pie chart with seven unequal slices (25%, 20%, 18%, 17%, 10%, 10%, 10%) all of them will be colored differently. So far I have made Pens and Brushes with colors attached and drawn a circle. This is what I have so far private void Form1_Paint(object sender, PaintEventArgs e) { this.BackColor = Color.White; this.Text = "Pie Chart"; this.Width = 350; this.Height = 350; Pen black = new Pen(Color.Black); Pen blue = new Pen(Color.Blue); Pen