drawing

NSView leaves artifacts on another NSView when the first is moved across the second

I have an NSView subclass that can be dragged around in its superview. I move the views by calling NSView's setFrameOrigin and setFrameRotation methods in my mouseDragged event handler. The views are both moved and rotated with each call. I have multiple instances of these views contained by a single superview. The problem I'm having is...

Let the end user draw shapes on bing maps (Virtual Earth)

How to let the end user draw shapes at runtime on bing maps (Virtual Earth)? ...

problem in drawing using core graphics

hi every one, am making a drawing application for iphone, am facing a prob when i use the core graphics, i am using the CGContext for drawing, and my code is in touchesMoved method, my problem is, if i use the same way in openGL it seems gud, and am getting smooth drawing but, this core graphics guy, also have the same code, but he works...

Manual Painting Issue

I'm having some strange drawing artefacts that I'm hoping someone might be able to help me pin down. Basically I have a left docked panel that is supposed to have a gradient background that hasn't been working right. I've changed the colours for debugging The panel is docked left, and has a transparent control on it (hence you ca...

draw using mouse drag event in JOGL.

Hi, Well Guess I could need some help here. I'm new to JOGL, and I am trying to draw on the 3d canvas perhaps just anything, but the point is to use mouse drag events. Any idea how am I be able to do that? I try something as below but it did not worked out. And also in the below codes, I do not understand why the display() method is b...

FillRectangle has no effect on Graphics from Bitmap?

I have code: using (Graphics g = control.CreateGraphics()) { Bitmap bm = new Bitmap(r.Width, r.Height, g); using (Graphics gbm = Graphics.FromImage(bm)) { gbm.FillRectangle(Brushes.Green, r); form.BackgroundImage = bm; form.BackgroundImageLayout = ImageLayout.Zoom; } } But that FillRectangle doe...

How do I do the equivalent of a Graphics.DrawString() in WPF?

I'm creating a WPF application (in C#) and I need to be able to draw strings using the C# code, not the XAML. The strings will be changing rapidly, so whatever method I use should be able to reflect that. I like the graphics.drawstring method in windows forms. Is there anything similar I can use in WPF? Edit: Creating FormattedText see...

How to draw in C#/WinForms with decent speed?

I'm trying to visualise a graph and allow people to play with it. I found the excellent Graph# library that can create an initial layout so that part is covered. Now I need to make a control that actually draws it and provides the necessary interactivity. Graph# comes with a nice visualiser itself, however I don't like it because it is ...

How would you implement Undo in a raster drawing program?

You're making a drawing program like Paint. You want to be able to undo/redo brush strokes. How would you implement this? Optimize for speed and memory. ...

Drawing a Smooth Line from Tablet Input

As the user drags their stylus across the tablet, you receive a series of coordinates. You want to approximate the pen's path with a smooth line, trailing only a few sample points behind it. How would you do this? In other words, how would you render a nice smooth responsive line as a user draws it with their tablet? Simply connectin...

Double buffering in BlackBerry?

Do we need to do double buffering in BlackBerry while rendering our paint code or does BlackBerry handle that? If we need to do that ourselves, how do we do that? ...

Most basic transformed vertex-drawing with Direct3D

I'm absolutely new to DirectX and I'd like to draw some untransformed primitives with the most basic Direct3D configuration (for learning purposes). I already drew some primitives with transformed vertices, that is vertices with the D3DFVF_XYZRHW flag set. Now I'm trying to get the same output with untransformed vertices, but I don't ge...

Rendering WPF DrawingGroup to single ImageSource

Currently I'm using a System.Windows.Media.DrawingGroup to store some tiled images (ImageDrawing) inside the Children-DrawingCollection property. Well the problem is now, this method gets really slow if you display the entire DrawingGroup in an Image control, because my DrawingGroup can contain hundreds or even thousands of small images ...

How to draw a graph (visual cirular nodes and lines as connections) in Visual Basic?

The problem is I have 10 nodes(say) and there are some connections between them. Now I want to draw a visual graph depicting the above with circles as nodes and lines as connections between them. My problem is what is the algorithm for placement of nodes on screen, say we have drawn one circle, then the other circle should be drawn as no...

How to present wave form in Java

Hi all, I've got this small code that performs recording in java. I whish to add some sort of functionality to draw a visual presentation of this. How would you advise me to approach this? (I am very new to java ) I'd like the visual presentation to appear as a foreground of a current existing image. ...

Creating a Hand-Drawn effect using .NET

I'd like to write a piece of code which creates images similar in style to those rendered by 'Balsamiq Mockups' or 'yUML' using the .NET framework. Can anybody tell me how to achieve the hand-drawn pencil effect using GDI+? The text can obviously be done using the right font - my question is how to render the lines, boxes and circles. ...

A draw-encoding algorithm similar to one in Google maps

As some of you may know, there is an encoding algorithm in Google maps API which optimizes polyline drawings in different zoom levels. It removes-adds the coordinates of a path according to the current zoom level and decreases-increases the drawing computation time. Specifically, I mean the algorithm in the GPolyline.fromEncoded method. ...

What's the best way of drawing layered OpenGL ES content?

Hi, Anyone know what the best practices are for drawing multiple layers of 2D OpenGL ES content on the iPhone? For example, let's say I want to draw a complex fullscreen background texture, followed by a rotating texture, followed by another alpha blended texture on top. Is there a way to draw the background texture only ONCE, and onl...

Fastest iPhone Blit Routine?

I have a UIView subclass onto which I need to blit a UIImage. There are several ways to skin this cat depending on which series of APIs you prefer to use, and I'm interested in the fastest. Would it be UIImage's drawAtPoint or drawRect? Or perhaps the C-based CoreGraphics routines, or something else? I have no qualms about altering my so...

How to draw text on the desktop in Windows ?

How Would I go about placing text on the windows desktop? I've been told that GetDesktopWindow() is what I need but I need an example. ...