Questions tagged [graphics]

Graphics are visual presentations. Questions using this tag should also be tagged with the appropriate language and graphics subsystem in use. For more general graphics questions, consider Computer Graphics Stack Exchange (computergraphics.stackexchange.com).

Graphics

The tag should be assigned to questions about constructing, displaying and manipulating visual presentations. Questions should also be tagged with the appropriate language and graphics subsystem in use. For more general graphics questions, consider Computer Graphics Stackexchange.

While historically there were two parallel developments of vector and raster (bitmap) systems, modern systems all implement the raster model at the hardware layer but may use extensive applications of vector graphics techniques at higher levels. The entire chain through the various levels to go from model to picture on screen is known as the pipeline.

The Borland Graphics Interface (graphics.h) has its own tag:

Examples

Construction:

  • How to turn raw data into a bitmap?
  • How to generate a chart, how to draw using vectors?
  • How to load a .3ds file and display the model?

Displaying

  • How to display a large bitmap scaled down?
  • How to use an image as a texture for a control?
  • How to ray-trace voxel data?

Manipulating

  • How to modify images using common effects such as filters?
  • How to create animations?

Counterexamples

  • How to draw using a paint program? --> too basic, not programming related
  • How to take a picture when there is not enough light? --> see Photography
  • How to scan a pencil drawing? --> software tools, see SuperUser
  • What graphics card should I buy? --> shopping questions are off-topic on most SE sites

Resources

Free Graphics Programming Books

20510 questions
91
votes
6 answers

What are Vertex and Pixel shaders?

What are Vertex and Pixel shaders? What is the difference between them? Which one is the best?
Paulo
  • 7,123
  • 10
  • 37
  • 34
89
votes
2 answers

Java2D: Increase the line width

I want to increase the Line2D width. I could not find any method to do that. Do I need to actually make a small rectangle for this purpose?
Boolean
  • 14,266
  • 30
  • 88
  • 129
89
votes
7 answers

Fast rectangle to rectangle intersection

What's a fast way to test if 2 rectangles are intersecting? A search on the internet came up with this one-liner (WOOT!), but I don't understand how to write it in Javascript, it seems to be written in an ancient form of C++. struct { LONG …
Robin Rodricks
  • 110,798
  • 141
  • 398
  • 607
86
votes
5 answers

How to make text glow?

Can we apply glowing effect to any text like shown below: Updated: Please also tell me what things i need to create something like this: Do i need a Special font for this?
Farhan
  • 13,290
  • 2
  • 33
  • 59
85
votes
7 answers

Do not want scientific notation on plot axis

I regularly do all kinds of scatter plots in R using the plot command. Sometimes both, sometimes only one of the plot axes is labelled in scientific notation. I do not understand when R makes the decision to switch to scientific notation.…
user438602
83
votes
6 answers

How can I do GUI programming in C?

I want to do Graphics programming in C. I had searched a lot about the compiler that provides a rich set of functions for doing GUI programming in C, but I couldn't find anything. Basically I want to draw buttons and then accept the choice from the…
Algorithmist
  • 6,657
  • 7
  • 35
  • 49
82
votes
13 answers

Creating SVG graphics using Javascript?

How can I create SVG graphics using JavaScript? Do all browsers support SVG?
user123757
  • 829
  • 1
  • 7
  • 4
76
votes
3 answers

Scaling a System.Drawing.Bitmap to a given size while maintaining aspect ratio

I want to scale a System.Drawing.Bitmap to at least less than some fixed width and height. This is to generate thumbnails for an image gallery on a website, so I want to keep the aspect ratio the same. I have some across quite a few solutions but…
Michael J. Gray
  • 9,784
  • 6
  • 38
  • 67
75
votes
10 answers

How to convert a 3D point into 2D perspective projection?

I am currently working with using Bezier curves and surfaces to draw the famous Utah teapot. Using Bezier patches of 16 control points, I have been able to draw the teapot and display it using a 'world to camera' function which gives the ability to…
Zachary Wright
  • 23,480
  • 10
  • 42
  • 56
73
votes
6 answers

Center text output from Graphics.DrawString()

I'm using the .NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter what I set for the Y coordinate of the location of…
Adam Haile
  • 30,705
  • 58
  • 191
  • 286
71
votes
12 answers

Millions of 3D points: How to find the 10 of them closest to a given point?

A point in 3-d is defined by (x,y,z). Distance d between any two points (X,Y,Z) and (x,y,z) is d= Sqrt[(X-x)^2 + (Y-y)^2 + (Z-z)^2]. Now there are a million entries in a file, each entry is some point in space, in no specific order. Given any point…
Kazoom
  • 5,659
  • 16
  • 56
  • 69
71
votes
4 answers

Getting R plots into LaTeX?

I'm a newbie to both R and LaTeX and have just recently found how to plot a standard time series graph using R and save it as a png image. What I'm worried about is that saving it as an image and then embedding it into LaTeX is going to scale it and…
agentofuser
  • 8,987
  • 11
  • 54
  • 85
69
votes
10 answers

Setting background color for a JFrame

How do you set the background color for a JFrame?
Raji
68
votes
3 answers

How does glDrawArrays know what to draw?

I am following some begginer OpenGL tutorials, and am a bit confused about this snippet of code: glBindBuffer(GL_ARRAY_BUFFER, vertexBufferObject); //Bind GL_ARRAY_BUFFER to our handle glEnableVertexAttribArray(0); //? glVertexAttribPointer(0, 3,…
w4etwetewtwet
  • 1,330
  • 2
  • 10
  • 20
67
votes
11 answers

smallest filesize for transparent single pixel image

I'm looking for the smallest (in terms of filesize) transparent 1 pixel image. Currently I have a gif of 49 bytes which seems to be the most popular. But I remember many years ago having one which was less than 40 bytes. Could have been 32…
zaf
  • 22,776
  • 12
  • 65
  • 95