drawing

What are the hard bounds for drawing coordinates in GDI+?

I am rendering an interpolation curve thusly: e.Graphics.DrawLines(new Pen(Color.Red), _interpolationPoints.ToArray()); which sometimes throws an OverflowException. Examination of the _interpolationPoints array shows some very large values in scientific notation e.g. {X = 0.0 Y = -1.985174E+10} I suspect that Y = -1.985174E+10 is a...

C# Drawing on Control at Design Time

I'm drawing a rounded rectangle on a control. At first I was only binding a paint handler to the Paint event at runtime: this.Paint += new PaintEventHandler(Panel_Paint); Then I figured out I can just override OnPaint which should then cause the drawing at design time, too: protected override void OnPaint(PaintEventArgs e) { bas...

How can a programmatically draw a scalable, aethetically-pleasing, curved comic-book balloon tail?

As a UI specialist, I am often asked to build tool-tip displays and other sorts of popups that display text. One of styles clients seem most keen on is text in a comic-book balloon. I would like to create this balloons programmatically (as opposed to embedding or linking to rendered graphics), because these balloons will have to change s...

Java: getting the absolute position of the mouse in a JPanel given the coordinate the user clicked on.

For example, suppose I have a drawing in a JPanel subclass with JScrollPanes, and I want to capture the points the user clicks on. Suppose, for example, the drawing area inside the JPanel goes from 0 to 10000, while the screen size isn't known a priori. Given the mouse coordinates in the click event thing, is it possible to determine whe...

visual styles independent drawing

Using C# winforms, i want to create custom controls that looks like the real ones. There are a lot of classes that can be used to draw controls that looks like the real ones: ControlPaint, VisualStyleRenderer, ButtonRenderer, CheckBoxRenderer, ComboBoxRenderer, GroupBoxRenderer, ProgressBarRenderer, RadioButtonRenderer, ScrollBarRendere...

Canvas professional drawing effects

Recently I've been learning HTML5 stuff, especially canvas. I looked at many online drawing applications written in Flash(e.g. http://www.sumopaint.com, http://www.onemotion.com/flash/sketch-paint/) and they all seem packaged with awesome drawing effects. Smooth lines, simulated pencil/brush etc. What I'd like to know is - is there a ...

create polygon filled up with dots

Am using the below code to create polygon. i just want to fill this polygon surface with black dots, how i can do that, then i want to convert this polygon to bitmap or in memory stream, how to do this?? // Create a blue and a black Brush SolidColorBrush yellowBrush = new SolidColorBrush(); yellowBrush.Color = Colors.Tr...

JQuery Shuffle Effect using Html5 [Canvas +CSS +JS]

Hi All, I saw a JQuery Shuffle Example and I was trying to implement the same using HTML5 and Canvas + CSS + JS with images. but finding animation/drawing using Canvas bit difficult. I just had idea of creating as many canvas as images and then try to move the canvas for shuffle animation. Are there any libraries to achieve the same...

Custom View extending the View-Class but still based on a XML-Layout

I want to build my own custom view which should look like the Crysis-GUI. At first I designed a XML-based Layout and made it visible via the setContentView(int resid)-Method. Worked pretty well. But now I wan't to go a step further and draw in my Layout. So I created a new Class, let it extend View and overrode the onDraw()-Method. So ...

Draw onto a ImageView

I studied the Androidreference for hours now, but don't really get the clue how to draw something (Text, Bitmap, Path ....) on a ImageView. Should I extend View and use the onDraw()-Method? If yes, how can I draw on my ImageView? Or is there any other way to achieve my goal? ...

Drawing tools in C# + library code or component

Hi Can any one introduce me a code library or framework to use for drawing in C# like DRAWCLI Sample in VC++ ? thx ...

The proper way to save/restore OpenGL ES state.

Hey all, I know that to save/restore matrix state you use standard push/pop operations. I haven't been able to find a decent convention for saving/restoring state such as when using glLineWidth() or glColor4ub(). It seems not really necessary as long as you set your line width or color up properly whenever you want to draw anything but...

pixelwise drawing in pyglet (python)

OK. I'm tired of googling and reading throught lots of documentation with no results. My aim is simple: get pyglet to draw an image pixel by pixel. I've been searching for hours with no results. Can anyone give an example of a short program that draws in a display specifying the color pixel by pixel? (for example, drawing a gradient fro...

Drawable object where I can store points for faster paint?

I'm designing a custom view which is an X/Y Plot. It's a moving graph that scrolls to the left with time and new Y values are continuously coming in at 10 per second. I've been able to make it work with an array of integers where the array index is the X value and the integer value is the Y value, but this seems horribly inefficient (B...

Force redraw of custom cocoa control on property change

Lets say I have a custom control called FooBox. It is just a square on the screen. It has some properties like color, border, etc. When I change the properties, I want the FooBox to redraw itself to reflect its new properties. Is there a way to do that without writing custom setters and putting [self setNeedsDisplay:YES] into all of them...

erase lines after drawing them in PyGTK- Cairo

hi, I want to ask how can I erase a line witch I've drawn by using the pyGTK I used:cairo library cr = widget.window.cairo_create() cr.move_to(x, y) cr.line_to(x1, y1) cr.stroke() I want to delete this line after drawing it on screen ...

How to append drawings to existing CGLayer effectively

Hi, I'm working on a drawing app. Currently all the user's drawings are drawn into separate CALayers. To improve the responsiveness of freehand drawing when the CALayer's path gets large, I am caching parts of the path at regular intervals in a CGLayer. The following code shows how I have implemented this within the CALayer's drawInCont...

Drawing the curve y = 1 - x ^ 4 in Processing/Java

I understand that y = x ^ n would be float y = (x, n) but what if i wanted to draw the curves y = 1 - x ^ 4 y = (1-x) ^ 4 y = 1-(1-x) ^ 4 Here's the code i wrote but it doesn't draw the curve mathematically correct for y = 1 - x ^ 4 for (int x = 0; x < 100; x++) { float n = norm(x, 0.0, 100.0); float y = pow(1-n, 4); y *= 100;...

OpenCV: Drawing on an image

Hello everyone! I am working on a program using the OpenCV library (though I am quite a noob on it). One of the things I need to do is to draw on the image. I looked at the OpenCV drawing functions and they all seem pretty simple (Circle, Line, etc), however the program won't compile! It says this to be exact: error C3861: 'Line': identi...

Primitive thickness - DX10

Hello, i recently stepped into primitive rendering in directX10. I need that because i want to convert my ingame chat from directx9 to 10 due my huge performance lag being forced by the games weak dx9 support. The lines are being rendered fine on the positions i want. My actual problem is that they doesnt appear as thin as in directX9 ...