graphics

How to draw a gif animation in java? [duplicate]

廉价感情. 提交于 2019-12-29 08:57:24
问题 This question already has answers here : Show an animated BG in Swing (3 answers) .gif image doesn't moves on adding it to the JTabbed pane (1 answer) Closed 5 years ago . I have some gif animated images (see sample image below) and when I draw them with the graphics object, I am getting only the first image, I know I can do this with JLabel (from other stackoverflow answers) but I want to do that with the graphics object, can anyone please tell me an easy way how to draw the whole animation?

D3: Select and alter external SVG?

一笑奈何 提交于 2019-12-29 07:51:33
问题 Is it possible to select and alter elements in an embedded (external) SVG , created in Adobe Illustrator? html: <object data="circles.svg" type="image/svg+xml" id="circles"></object> circles.svg: <svg xmlns="http://www.w3.org/2000/svg" width="100px" height="100px" > <circle id="c_red" fill="#A00" stroke="#000" cx="40" cy="40" r="40"/> <circle id="c_grn" fill="#0A0" stroke="#000" cx="60" cy="60" r="40"/> </svg> d3 code: <script> var my_circles = d3.select("#circles svg").selectAll("circles");

iOS Graphical Issue

ε祈祈猫儿з 提交于 2019-12-29 07:17:27
问题 so I am creating a side scrolling shooter game but am having an issue with some of the graphics occasionally. I'm running into this mysterious line that appears. As you can see on the image below it appears on some but not all the sprites. How can I go about fixing this? Is this mine or the artists mistake? I am developing with Cocos2d and using a CCSpriteBatchNode and my sprite sheet is a .png, not sure if the information is relevant just thought I'd leave as much info possible. Any ideas???

How I obtain bars with function bar3 and different widths for each bar?

為{幸葍}努か 提交于 2019-12-29 06:47:29
问题 I have the code: values = [1.0 0.6 0.1; 0.0 1.0 0.3; 0.9 0.4 1.0]; h = bar3(values); shading interp for i = 1:length(h) % Get the ZData matrix of the current group zdata = get(h(i),'Zdata'); set(h(i),'Cdata',zdata) end set(h,'EdgeColor','k') view(-61, 68); colormap cool colorbar And this is what the figure looks like: I want to obtain different widths for each bar dependent on the height of the bar. What I want looks like a picture in http://www.sdtools.com/help/ii_mac.html. blah http://www

How can we Draw a lines between 2 panels in swing

大城市里の小女人 提交于 2019-12-29 06:23:44
问题 Just want to connect panels by drawing a line b/w them. I am having two panels and both panels contains a Jtable.I want to connect each cell of jtable of one panel to another Jtable of another jpanel. Here i want to draw the lines like that i have highlighted by pink color circle. and this is the code snippet i am using to create jtables DefaultTableModel fcdbDataModel = new DefaultTableModel(fcdbIdTxnArray, fcdbIdTxnColumnArray); fcdbIdTxnJTable = new FieldMapperJTable(fcdbDataModel); here

Linear Gradient Brush Fade WPF

为君一笑 提交于 2019-12-29 06:19:16
问题 I have a brush that colors the background of a header. I like the way the brush looks but would like it to fade to transparent in the bottom third. Any ideas how to do this? <LinearGradientBrush x:Key="HeaderBackgroundBrush" EndPoint=".5,1" StartPoint="1,0"> <GradientStop Color="#006699" Offset="1"/> <GradientStop Color="#80A8CC" Offset="0.5"/> </LinearGradientBrush> 回答1: I'm not sure you can do it by working only at the brush level, however you could apply an OpacityMask to your control:

How to render ocean wave using opengl in 3D? [closed]

℡╲_俬逩灬. 提交于 2019-12-29 05:00:08
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . How to render ocean waves using opengl in 3D? Any reply will be welcome. Edit: Is there any source code that renders ocean waves but not using an other sdk or api? It's difficult to learn how render it by read

Set individual pixels in .NET Format16bppGrayScale image

妖精的绣舞 提交于 2019-12-29 04:47:27
问题 I'm trying to render a small Bitmap in memory with .NET that needs to be 16 bit Grayscale. The bitmap's format is set to PixelFormat.Format16bppGrayScale. However, Bitmap.SetPixel takes a Color argument. Color in turn takes one byte for each of R, B, and G (and optionally A). How do I specify a 16-bit gray scale value rather than an 8 bit value when drawing to my bitmap? 回答1: Regardless of the image format, SetPixel() is brutally slow. I never use it in practice. You can set pixels much

How can I render a square bitmap to an arbitrary four-sided polygon using GDI?

与世无争的帅哥 提交于 2019-12-29 03:38:05
问题 I need to paint a square image, mapped or transformed to an unknown-at-compile-time four-sided polygon. How can I do this? Longer explanation The specific problem is rendering a map tile with a non-rectangular map projection. Suppose I have the following tile: and I know the four corner points need to be here: Given that, I would like to get the following output: The square tile may be: Rotated; and/or Be narrower at one end than at the other. I think the second item means this requires a non

Can't flip direction of ball without messing up gravity

别等时光非礼了梦想. 提交于 2019-12-29 02:12:09
问题 I am making a game like pong except that there is only one paddle and the ball moves in projectile motion. The goal is to keep the ball bouncing on your paddle for as long as possible. I when I have the ball hit the paddle the direction of the y component of the velocity has it's sign flipped. The issue with this is that when the ball is moving up gravity acts upon in in that direction, speeding it up. The code is below This is the code for my ball class, this is the tick method which is