graphics

Is drawing through the Canvas class hardware accelerated on Android?

Are calls to Canvas.drawPath()/drawArc()/etc hardware accelerated, passed to a device native implementation or implemented in Java? Or is OpenGL the only way to achieve hardware accelerated drawing? I am trying to determine if it is feasible to use the Canvas API for realtime animation. ...

Android: Difference between SurfaceView and View?

When is it necessary, or better to use a SurfaceView instead of a View? ...

How do I draw curved lines on an HTML page using JavaScript?

Is it possible to draw curved lines in an HTML page (normally across cells in a table) using JavaScript (for web graph control)? ...

Rotate string to write vertically on bitmap

I'm building a Bitmap by layering images one above another, and when I'm done I want to write text around the edges. The top and bottom are simple because they're written horizontally, but I'd prefer to write the text on the left and right sides vertically so they don't take up as much space. The Graphics.DrawString method doesn't allow...

C++ pixel level control over graphics

I have been looking all over the web for the simplest solution for this, and currently I have come across nothing that seems simple enough for my needs. I am looking for a way to manipulate a matrix of pixels manually in C++, platform independent. Does anyone know of a library that is simple to use that will help me obtain this? ...

C#: Paint own Bar Chart

Hello, I'm trying to paint a simple bar chart via C# but I've never experimented with the Graphics and Drawing namespaces. I thought of generating a "start" and "end" graphic and then repeating an image somehow (to show a "length") but I have no idea how to do this. I'd be really happy if you can point me in the right direction and/or ...

Finding points on a line with a given distance

I have a question i know a line i just know its slope(m) and a point on it A(x,y) How can i calculate the points(actually two of them) on this line with a distance(d) from point A ??? I m asking this for finding intensity of pixels on a line that pass through A(x,y) with a distance .Distance in this case will be number of pixels. ...

How to combine repaints in Swing?

I am calling repaint a bunch of times from a listeners, but the way I designed my paint function is only one repaint is required. I generate a bunch of repaints, since it hooked into my mouse motion listener. Is there a way to cancel all pending repaints for a certain component? I can't just start ignoring repaints, since some are val...

Store a screen capture (Bitblt) in a memory buffer to send over IdTCPClient

In c++ builder 6 on windows vista ... Graphics:: TBitmap * bmpscreencapture = new Graphics::TBitmap; bmpscreencapture-> Height = Screen-> Height; bmpscreencapture-> Width = Screen-> Width; HDC ScreenSrc = GetWindowDC (0); BitBlt (bmpscreencapture-> Canvas-> Handle, 0, 0, Screen-> Width, Screen-> Height, ScreenSrc, 0, 0, SRCCOPY); Canvas...

How do I create a Bezier curve to represent a smoothed polyline?

I have a polyline that approximates a curve, and I want to draw it as a smooth curve in PostScript, which supports Bezier curve drawing. To do that, I need to generate two control points between each pair of polyline points. (I can't get the original curve from the source, just the polyline.) I've had some success using cardinal spline...

Changing a matrix from right-handed to left-handed coordinate system

I would like to change a 4x4 matrix from a right handed system where: x is left and right, y is front and back and z is up and down to a left-handed system where: x is left and right, z is front and back and y is up and down. For a vector it's easy, just swap the y and z values, but how do you do it for a matrix? ...

Find an image in an image C#

Hi I have a scan of a document (a form actually) filled with some handwritten infos. I have a bitmap of the form empty. how can i "cancel" the printed form to extract the handwritting only. I use C#... Thanks Jonathan ...

Draw a shadow behind UIWebView

I know similar questions have been asked before, so don't get snarky and link to previous answers. The reason I am repeating this is that none of the answers have worked. I have a UIWebView, and I want to draw a pretty drop-shadow behind it. I have tried subclassing and using some CoreGraphics goodness in drawRect:, but to no avail. Can...

Writing a 2D RTS game in C#: graphics library options?

I am considering writing a 2D RTS in C#/.NET and i was wondering what options are available for a graphics library aside from XNA. What are they? ...

How do I detect whether a graphic will be dithered?

Our application draws drop shadows beneath thumbnails. It does this by creating a bitmap, getting a Graphics object using Graphics.FromImage, and then overlaying images using Graphics.DrawImage. I'm using it today for the first time over remote desktop, and it looks awful, because the shadows are being dithered. I don't know whether t...

Path2D fill and draw algorithm

Hi, Does somebody know the algorithm that is been used to fill or draw a Path2D (GraphicsPath in .NET) object with a Graphics2D-object (Graphics in .NET). The algorithm isn't public in the Java-sources and .NET isn't public at all. I want to use it for some fast image-operations. Thnx ...

Removing black border around an image

I have a few JPG Images. Some of them may have a black border on one or more sides, and I'd like to remove them. The black border may not go around the actual image - some may only have the border at the bottom (with the actual image at the top), while some could be centered (which means black borders on two sides, but not connected). Wo...

Open source (under the MIT licence) library for loading and saving image files?

I am writing an imaging library (using the MIT licence) and would like to hook it up to a library that supports loading and saving of images in various file formats (bmp, png, jpg etc) I am aware of FreeImage, but it appears to use a GPL licence. Is there anything out there similar to FreeImage that uses MIT rather than GPL ? ...

argh! what is wrong with this floodfill algorithm?!

I have been using a floodfill algorithm of the stack-based non-recursive variety and it seems to work perfectly except for one annoying situation: if use a line to cut an image in half and then floodfill one half, it floods the whole image! This only happens, however, when I do not put 'borders' around the image. If i draw a rectangle th...

How to add graphics on top of a multiscaleimage?

I want to add graphics to a multiscaleimage. I use the project that Deep Zoom Composer auto generated when creating a multiscaleimage. Displaying the multiscaleimage from VS2008 works. I've tried this and added the graphics to the maincanvas, without any results: <Grid> <Canvas Name="maincanvas"/> <MultiScaleImage/> </Grid> Edit: W...