graphics

Application crashes when using graphics debugger with Nsight 2.2

和自甴很熟 提交于 2020-01-05 07:15:15
问题 Hi I am using NVidia Nsight 2.2 , have a GTS 450 card and latest drivers. Windows Vista 64 bit. When launching graphics debugger the application crashes on the very 1st drawcall. The callstack looks like this: nvwgf2um.dll!5bdd7d53() [Frames below may be incorrect and/or missing, no symbols loaded for nvwgf2um.dll] nvwgf2um.dll!5be9c7f7() nvwgf2um.dll!5bde377e() nvwgf2um.dll!5bc02afb() nvwgf2um.dll!5bc0257b() nvwgf2um.dll!5bc0259e() nvwgf2um.dll!5bdd0612() nvwgf2um.dll!5bcb2292() nvwgf2um.dll

Cropping whitespace from an Image

这一生的挚爱 提交于 2020-01-05 05:33:06
问题 Anyone know of a good method of cropping whitespace from an image? I have an external method which generates Image objects containing charts, but unfortunately they have lots of white space which I would like to remove. Thanks, Alex 回答1: Found a solution after googling for some different terms... Always happens... For reference: http://fitnessconnections.com/blog/remove-surrounding-white-space-from-an-image/ 来源: https://stackoverflow.com/questions/3767463/cropping-whitespace-from-an-image

Why are graphics not appearing in JFrame?

倖福魔咒の 提交于 2020-01-05 04:33:10
问题 Below I included two of the classes in my Java program (Launcher and Controls). In the both classes, they create a JFrame, draw a background image, and add lines of text. I have looked at the code over and over, but for some reason the background image and the line of text are not appearing in the second class (Controls). Could anyone please explain to me why this is happening? Launcher Class: import hungerGames.Display; import hungerGames.RunGame; import hungerGames.input.InputHandler;

Graphics2D line and shape drawing issues (rendered in wrong place)

老子叫甜甜 提交于 2020-01-05 04:08:47
问题 I've drawn three arrows using Graphics2D. three drawLine s draw(Shape) fill(Shape) Here's what it looks like enlarged: I cannot understand two things: Why is the filled one smaller and shifted? Secondly, why do arrows 1. and 3. look different? Both consist of 3 antialiased lines. Shouldn't they (potentially) differ only in vertices? Here's the whole code: import javax.swing.*; import java.awt.*; public class ShapeTest extends JPanel { public static void main(String [] args) { JFrame frame =

Compute textlength with letter-spacing with D3.js

你。 提交于 2020-01-05 04:06:56
问题 When I compute the text length of a textpath element the value doesn't change when I style the 'letter-spacing' differently. Is there a way to deal with the extra length due the extra spacing ? Currently I compute the textlength to hide some labels on a bilevel-partion graph: textsElements .attr("dy", function(d) { var offset = (radius / strokeWidth)/2; var rotation = getRotationDeg(d) return rotation > 0 && rotation < 180 ? -offset : offset; }) .append("textPath") .attr("startOffset", "50%")

Matlab: Adding symbols to figure

一笑奈何 提交于 2020-01-05 03:07:26
问题 Below is the user interface I have created to simulate LDPC coding and decoding The code sequence is decoded iteratively by passing values between the left and right nodes through the connections. The first thing it would be good to add in order to improve visualization is to add arrows to the connections in the direction of passing values. The alternative is to draw a bigger arrow at the top of the connection showing the direction. Another thing I would like to do is displaying the current

Matlab: Adding symbols to figure

落爺英雄遲暮 提交于 2020-01-05 03:07:06
问题 Below is the user interface I have created to simulate LDPC coding and decoding The code sequence is decoded iteratively by passing values between the left and right nodes through the connections. The first thing it would be good to add in order to improve visualization is to add arrows to the connections in the direction of passing values. The alternative is to draw a bigger arrow at the top of the connection showing the direction. Another thing I would like to do is displaying the current

Drawing “transparent” text via C# Graphics, but in a way that it turns the drawn text to be “missing” so it's transparent in the resulting image

纵然是瞬间 提交于 2020-01-05 02:52:25
问题 I am looking to draw a string on a DC (Graphics - I am using C#) - but I want the drawn text to be "deleted" from the image so that what's left is essentially a cut-out of the text. If I was to DrawString with a transparent brush obviously nothing would have happened. Is there a way of drawing something like that, or do I need to use 2 DCs and BitBlt with some combination of NOTs or XOR or whatever (I did similar things years ago, but was wondering if there's an easiery way)? 回答1: You could

Drawing “transparent” text via C# Graphics, but in a way that it turns the drawn text to be “missing” so it's transparent in the resulting image

*爱你&永不变心* 提交于 2020-01-05 02:52:06
问题 I am looking to draw a string on a DC (Graphics - I am using C#) - but I want the drawn text to be "deleted" from the image so that what's left is essentially a cut-out of the text. If I was to DrawString with a transparent brush obviously nothing would have happened. Is there a way of drawing something like that, or do I need to use 2 DCs and BitBlt with some combination of NOTs or XOR or whatever (I did similar things years ago, but was wondering if there's an easiery way)? 回答1: You could

Shader for counting number of pixels

谁说我不能喝 提交于 2020-01-05 02:34:12
问题 I'm looking for a shader CG or HLSL, that can count number of red pixels or any other colors that I want. 回答1: You could do this with atomic counters in a fragment shader. Just test the output color to see if it's within a certain tolerance of red, and if so, increment the counter. After the draw call you should be able to read the counter's value on the CPU and do whatever you like with it. edit: added a very simple example fragment shader: // Atomic counters require 4.2 or higher according