graphics

What is the most performant way to draw a rotated bitmap on an Android canvas?

谁都会走 提交于 2019-12-25 01:11:39
问题 I'm working on an app where we hand rolled some star maps. So I don't have to talk in the abstract, here is the app in question: https://play.google.com/store/apps/details?id=com.tw.fireballs If you look on the store listing, you can see we use an image just above the horizon...mostly because it looks super pretty. It's not an issue on lower resolution devices, they don't seem to suffer a huge issue rendering it due to lower number of pixels involved. On a higher resolution device like my HTC

Improving performance when working on Images with ASP.NET in VB

混江龙づ霸主 提交于 2019-12-25 00:32:09
问题 I am trying to speed up various aspects of my website. The site is a shopping site various search pages which are slow. There are several potential reasons for this, one being working with images. The other night I created a function which generates a thumbnail for my Facebook OG tags. The function writes a square image to the server 400px x 400px created by tiling the first few (up to 14) product images generated by a search query. Running this script in total isolation on a test.aspx file

Java Graphics Drawing Custom Circular

放肆的年华 提交于 2019-12-24 23:32:45
问题 I want to draw a shape at center that starts from the center of the panel and keeps expanding out in circular shape like in the picture link below : https://www.dropbox.com/s/lnxi1be8uogn2zx/20140320_124537.jpg but i am having difficulty with the center shape , its like it doesnt show up at all on the panel. Here is the class i wrote for the shapes package graphics.test; import java.awt.Graphics; import javax.swing.JPanel; public class DrawPanel extends JPanel { public void paintComponent

Straightening a curved contour

放肆的年华 提交于 2019-12-24 23:24:31
问题 Given a contour with an easily-identifiable edge, how would one straighten it and its contents, as pictured? 回答1: Detect the black edge and fit a spline curve to it. From that spline you will be able to draw normals, and mark points regularly along it. This forms a (u, v) mesh that is easy to straighten. To compute the destination image, draw horizontal rows, which correspond to particular normals in the source. Then sampling along the horizontal corresponds to some fractional (x, y)

Java slick2d moving an object every x seconds

Deadly 提交于 2019-12-24 22:19:45
问题 I am currently working on a 2d game in which a player sprite pushes other sprites around on the screen. My current code (within subclass): //x and y being the co-ords i want this object to move to (e.g 50 pixels right of its starting point etc.) public Boolean move(float x, float y, int delta) { this.setx(x); } How do i make the object move say 50 pixels every 1 second? or alternatively every x frames. I've tried using delta but that results in smooth motion which is much harder to control

Writing a script to output Frame rate/dropped frame statistics on Android

 ̄綄美尐妖づ 提交于 2019-12-24 22:00:56
问题 I would like to analyze the maximum frame rate when I run a few applications such as games and videos. I'm pretty new to Android so I'm not sure where I should start. 回答1: Maybe this tool will help you: http://developer.android.com/tools/help/gltracer.html You need device with api level 16 or higher. 来源: https://stackoverflow.com/questions/22998238/writing-a-script-to-output-frame-rate-dropped-frame-statistics-on-android

Using Graphics.DrawString to Simulate TextBox rendering

雨燕双飞 提交于 2019-12-24 21:19:22
问题 I have a C# UserControl that hosts a TextBox. When the custom control is disabled, I would like the TextBox to be rendered as if it were Disabled + ReadOnly (i.e. not greyed out). Therefore, when the custom control catches the EnabledChanged it sets the hosted TextBox properties accordingly. However, the Enabled state of the UserControl takes precedence over everything else and the TextBox is still rendered greyed out (even though its internal ForeColor is correct). Therefore, I decided to

Annoying Flash on UIView Flip Transition

放肆的年华 提交于 2019-12-24 20:32:59
问题 I'm trying to do a flip transition between a view, A-1, and a backside view, A-2, using UIView.transitionFromView:toView:. These views have a number of siblings, and since I don't want the entire superview to rotate, I insert a temporary container view that's just large enough to contain both A-1 and A-2 into the view hierarchy and insert A-1 into that immediately prior to the transition. The problem is that view A-1 disappears with an unsightly flash as soon as the transition starts, which

HTML speechbubble markup

烈酒焚心 提交于 2019-12-24 20:26:31
问题 fyi: i'm working on a HTML markup for some speechbubbles. The reason for this complex markup is that the speechbubble should grow with its content. So, first of all here my recent markup: <div class="speachbubble"> <div class="topbar"> <div class="corner top-left"></div> <div class="top"></div> <div class="corner top-right"></div> <div class="clear"></div> </div> <div class="middlebar"> <div class="left"></div> <div class="content">HERE iS SOME TEXT</div> <div class="right"></div> <div class=

Way to change transparency with java swing.image

痴心易碎 提交于 2019-12-24 19:28:20
问题 I draw graphics in frame with this methods. public void paint(Graphics g) { screenImage = createImage(1280, 720); screenGraphic = screenImage.getGraphics(); screenDraw((Graphics2D) screenGraphic); //g.drawImage(BG, 0, 0, null); g.drawImage(screenImage, 0, 0, null); } public void screenDraw(Graphics2D g) { g.drawImage(BG, 0, 0, null); Graphics2D g2 = (Graphics2D)g; if(isMainScreen) { //g2.setComposite(alphaComposite); g2.drawImage(selectedImage, 100, 220, null); } paintComponents(g); this