graphics

Graphics primitive generators

I'm looking for something that can generate primitives (e.g. rounded rectangles for dialog boxes etc) so I can load them into a DirectX textured Sprite. Functionality is like SPriG. ...

Are Bitmap.LockBits and Graphics.FromImage combinable in C#

Can you combine the methods of Bitmap.LockBits and Graphics.FromImage, or in other words if I have a bitmap "bmp" and I want to edit the bitmap with a Graphics-object g, are the changes visible in the byte-array of the BitmapData.Scan0: Bitmap bmp = new Bitmap(200,200); Graphics g = Graphics.FromImage(bmp); bmp.LockBits(new Rectangle(0,...

Painted Border Runs In Certain Situations

In my tool I use a a panel to change pages. Each page has it's own panel and when I change a page I send the panel with the controls. On the panel I use as the canvas I have the following paint event: private void panelContent_Paint(object sender, PaintEventArgs e) { e.Graphics.CompositingQuality = CompositingQuality.H...

How to make a graphics element draggable with google-closure?

How to make google closure graphics elements draggable and respond to events otherwise? Here's what I have so far. I have the circle, but can't drag it yet :). Thanks. goog.require('goog.dom'); goog.require('goog.graphics'); goog.require('goog.events'); goog.require('goog.fx.Dragger'); goog.provide('graphics_test'); graphics_test = f...

Graphic programming over video playback

I want to make some GUI mockup program for video player, so my idea is just to show some menu pictures over real video being playback. I have working program made with C and SDL just to load pictures and make a slideshow, but i don´t know how to put this over video with transparencies. Do you have a hint? ps. i usually program with pyt...

Direct3D Line thickness

How do I change the thickness of lines when drawing line lists using Direct3D? This post says that line width is not supported and goes on to provide a workaround. Other options? While we are on this topic, do shaders allow one to draw lines with dash patterns? ...

Calculate points to create a curve or spline to draw an elipse

I am working with Dundas maps and need to overlay the map with bubbles depicting some data. I want to add shapes to the map in order to achieve this. I can add a triangle (or any straight-line-polygon) like this: public static void AddShape(this MapControl map, List<MapPoint> points, Color color, string name) { if (points[0].X != po...

GDI+ How to change Line SmoothingMode?

Is it possible to change PowerPacks.LineShape smoothingMode? I tried to use this code(a class that inherits LineShape): Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = e.Graphics ' no difference when changing the SmoothingMode ' g.SmoothingMode = SmoothingMode.AntiA...

Java ImageIO: How can I read a BufferedImage from file, so that it uses DataBufferFloat?

Hello, everyone! I need to read a BufferedImage from file, which doesn't use DataBufferInt (as normally), but DataBufferFloat. Please note: I don't just need some standalone DataBufferFloat, but really a BufferedImage with underlying DataBufferFloat. The API around these things is very complex, I just can't find how to do this. Pleas...

Java custom Paint implementation performance issue

I'm using Java to create a game, and I'm using TexturePaint to texture areas in the background. Performance is fine using java.awt.TexturePaint, however, I want to have areas having an inherent rotation, so I tried implementing a custom Paint called OrientedTexturePaint: public class OrientableTexturePaint implements Paint { privat...

Java tiled paint

I'm writing a game, and I want an area of the screen to have a tiled paint drawn on it. Using a TexturePaint java supports texturing a Shape with a tiled texture, this is really simple and performs pretty well. However, I want my tiled texture to be rotated before drawing it as a fill to the shape - this is theoretically possible by subc...

How to pass generated image/bitmap/GDI objects to other process?

I have a process A that generates HBITMAP GDI objects to be painted on the screen. I have another process B which wants to display the content of images that process A creates. I plan to do the communications/talking using Point-to-Point message queue or by using other message passing; and use shared memory (along with mutex and or even...

Why does sign matter in opengl projection matrix

I'm working on a computer vision problem which requires rendering a 3d model using a calibrated camera. I'm writing a function that breaks the calibrated camera matrix into a modelview matrix and a projection matrix, but I've run into an interesting phenomenon in opengl that defies explanation (at least by me). The short description is...

Displacement map in .Net

I have built a Flex application that composes image resources, color layers, blurs etc to generate images (99% of the drink images in www.absolutdrinks.com are generated by this app). One of the effects used by the app is Flash's ability to apply displacement map filter in which x- and y- offset for an image is defined by a 2D image (sy ...

How can I "best fit" an arbitrary cairo (pycairo) path?

It seems like given the information in stroke_extents() and the translate(x, y) and scale(x, y) functions, I should be able to take any arbitrary cairo (I'm using pycairo) path and "best fit" it. In other words, center it and expand it to fill the available space. Before drawing the path, I have scaled the canvas such that the origin is...

Font in 'GraphicsPath.AddString' is smaller than usual font

For some reason if I add a string to GraphicsPath using AddString the font is going to be smaller than it looks like in the Font Dialog. SizeF sz = g.MeasureString(Text, new Font(Font.FontFamily, (int)(Font.Size - (Font.Size / 7)), Font.Style), new PointF(0, 0), StringFormat.GenericDefault); this.Size = new Size((int)sz.Width, (int...

Creating a simple drawing area widget with google closure.

Here I've tried to create a simple drawing area widget containing a single circle, using google closure. I load it by calling sketcher.load() within html script tag and get an error: Uncaught TypeError: Cannot set property 'Widget' of undefined - what is not right here? goog.provide('sketcher'); goog.require('goog.dom'); goog.require...

How do I arbitrarily distort a textured polygon?

I'd like to write a program that lets me arbitrarily distort a textured polygon by dragging its vertices. I want the texture to distort fluidly and without overlap, assuming the new polygon doesn't intersect itself. I should also be able to repeat the process with the new shape, and with a minimum amount of loss. Are there any algorithm...

Drupal voting module with an image per option

I've searched for a while and can't find this option. In Drupal 6.15 I'm trying to setup a Poll that will allow me to upload an image for each option to vote on, and have the image inline with the radio button. Also I'd like to have a text field for each option to describe the image. thanks ...

Cand Jung graphics apear in the same place every time?

Hello, I'm using JUNG ( http://jung.sourceforge.net/index.html ) to draw graphics in java. The software is great but I have a small question. How can I be sure that the displayed graph is each time the same (no changes is architecture or position)? To be more specific: the graph model (data to be represented) doesn't change but its rep...