rendering

Swing/JFrame vs AWT/Frame for rendering outside the EDT

隐身守侯 提交于 2019-12-12 10:48:04
问题 What are the principle differences between using an AWT Frame and a Swing JFrame when implementing your own rendering and not using standard Java GUI components? This is a follow on from a previous question: AWT custom rendering - capture smooth resizes and eliminate resize flicker The typical talking points on Swing vs AWT don't seem to apply because we're only using frames. Heavyweight vs Lightweight goes out the window (and JFrame extends Frame), for example. So which is best, JFrame or

In WPF how can I get the rendered size of a control before it actually renders?

倖福魔咒の 提交于 2019-12-12 10:41:25
问题 I'm doing custom rendering in a Decorator subclass. Our rendering requires creating complex geometries which only neded to be re-created when the actual rendered size changes. As such, I have moved the geometry creation into its own function called UpdateGeometry which creates, then freezes the geometry for use in OnRender . This new function only needs to be called in response to a change in ActualWidth or ActualHeight . Even better, it looks like we should be able to simply override

Render HTML string in Node?

旧街凉风 提交于 2019-12-12 08:21:46
问题 Alright, so I have downloaded Express, set the port with process.env.PORT || 8080 , and set the app variable var app = express() . Now, what I'm trying to accomplish is instead of rendering HTML through a file, could I do it through a string? var html = "<!DOCTYPE html>\n<html>\n <head>\n </head>\n <body>\n <h1>Hello World!</h1>\n </body>\n</html>"; app.get('/',function(req,res){ res.render(html); }); Is there a possible way to do this? 回答1: the res.render method as specified in the doc :

Multiple Render Targets not saving data

折月煮酒 提交于 2019-12-12 08:13:19
问题 I'm using SlimDX, targeting DirectX 11 with shader model 4. I have a pixel shader "preProc" which processes my vertices and saves three textures of data. One for per-pixel normals, one for per-pixel position data and one for color and depth (color takes up rgb and depth takes the alpha channel). I then later use these textures in a postprocessing shader in order to implement Screen Space Ambient Occlusion, however it seems none of the data is getting saved in the first shader. Here's my pixel

How to extract images from pdf using Java (not using pdfbox)

血红的双手。 提交于 2019-12-12 08:09:23
问题 I've being researching on how to extract images from a big (> 300MB) PDF file. I'm using pdfbox but for some particular reason that I can't figure out, some pages are not correctly extracted. I'm using the PDFToImage class of pdfbox as base for my code. So, do you know another library that may help me to do this? I know that iText may be used, but I read that it can't be used for commercial products. I've installed the packages xpdf and xpdf-utils, and the utility called pdfimages is working

What are some faster alternatives to Java2d?

六眼飞鱼酱① 提交于 2019-12-12 07:41:46
问题 I'm looking to do some physics simulations and I need fast rendering in Java. I've run into performance issues with Java2d in the past, so what are the fast alternatives? Is JOGL significantly faster than Java2d? 回答1: My experience with Java2D is that it can be very fast, if you follow the rules. I had an application that went from 90% CPU to less than 5% CPU just by changing a few simple things. Using large transparent PNG's is a no no, for example. A very good resource is the Java-Gaming

Put a text onto a game-object BUT as if it was painted

会有一股神秘感。 提交于 2019-12-12 07:38:55
问题 I was looking for this answer on the web for some time. But apparently my search phrases were wrong or it is really that hard. But I doubt it. Imagine, I have any 3d-body. A sphere, cylinder or cube. I want to put a text onto that object. As if it was a sticker or painted onto that object. Meaning, it would follow the objects curves or edges, if wrapping around them. I managed to create some texts which are ALWAYS in front or behind my object. But that is not what I want. The closest to what

zoom out in OpenGL in android

不打扰是莪最后的温柔 提交于 2019-12-12 07:38:39
问题 I m using 3D object and rendering it and showing it by extends GLSurfaceView implementing Renderer, the problem is that how to do zoom out-in with pinch-in and pinch-out. Below is my class package com.example.objLoader; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLSurfaceView; import android.opengl

Text in QML rendered different accross platforms

你。 提交于 2019-12-12 07:18:59
问题 I am seeing inconsistencies in the rendering of text between different platforms: The image on the top left is produced in android, and as the red guide lines indicate, it differs from the "reference" windows output in terms of vertical position and angle of the italic style. Rectangle { width: 100 height: 50 color: "grey" Text { x: 4 y: 2 font.family: sysfont font.pixelSize: 13 width: contentWidth color: bgc text: "Type" } Text { x: 5 y: 13 font.family: sysfont font.pixelSize: 32 font.italic

OpenGL cube vertices are wrong

*爱你&永不变心* 提交于 2019-12-12 06:42:57
问题 I've been trying to solve the problem of my cube vertices being incorrect for well over a day now without much luck. I've tried about 10 different vertex arrays, but none have worked. The problem is that I don't really understand how someone goes about figuring out what number goes where, so I can't really debug it myself. Here is my code at the moment. I think it's relatively straightforward for someone familiar with OpenGL, but if you have any questions ask. EDIT: The problem now is that