paint

I need an algorithm for rendering soft paint brush strokes.

I have an array of mouse points, a stroke width, and a softness. I can draw soft circles and soft lines. Which algorithm should I use for drawing my array of points? I want crossed lines to look nice as well as end points. ...

How do I get the image paint/paintComponent generates?

Hey guys. I have a quick question. How do I get the image generated by a JComponent.paint or paintComponent? I have a JComponent which I use as a 'workspace' and where I have overwritten the paintComponent method to my own. The thing is that my workspace JComponent also has children which has their own paintComponent methods. So when ...

Getting drawable area of an AWT frame in Mac OS X?

I have subclassed java.awt.Frame and have overridden the paint() method as I wish to draw the entire contents of the window manually. However, on the graphics object, (0,0) corresponds to the upper left hand corner of the window inside the title bar decoration, not the first drawable pixel. Can I determine the co-ordinate of the first ...

How to save an image-file on server through Java applet?

I have a paint application that runs as a Java applet. I need to save the contents of the canvas on server machine in any image-format typically PNG. Please help! ...

How do I StretchDraw two graphics beside each other on a custom TGraphicControl?

I'm writing my Delphi TGraphicControl paint procedure. I create a canvas and I stretchdraw it onto the graphic area. It works well. Then I repeat this with another Stretchdraw onto the graphic area but it is drawn in the area of the first Stretchdraw and not onto the graphic area as I direct it. Is there a way that can place both stre...

PictureBox resize & paint problem

I want to show some graphics in a Winform app, it will be a stock's chart drawing tool. I think (but I am not sure...) I have to use a PictureBox, and using the System.Drawing.Graphics class' drawing primitives to draw the chart. I have started coding it, now it works more-or-less, but I have a problem with the resizing feature, as follo...

.NET: Painting (clipping) only part of a control?

I have a VB.NET program where I'm using a WebBrowser control to simulate a timesheet form. For data entry, I'm using a DateTimePicker control that sits on top of the WebBrowser control, which I have programmed to move on top of the cell of the table in the WebBrowser control when the WebBrowser control is clicked on. (If you want to ask ...

How to create MS Paint clone with Python and pygame

As I see it, there are two ways to handle mouse events to draw a picture. The first is to detect when the mouse moves and draw a line to where the mouse is, shown here. However, the problem with this is that with a large brush size, many gaps appear between each "line" that is not straight since it is using the line's stroke size to c...

Simple open source paint program

I am trying to experiment with expanding paint-like program adding custom features to it. Can you suggest a simple open source paint-like program written in C and using GTK+ library which I could expand? It should compile in Linux but also in Windows (using MinGW). Thanks. EDIT: I found this and it looks like something I was looking fo...

Reverse Engineering old paint programs.

I've got a couple of really old MSDos based paint programs. They work on palette indexed image buffers. They have a number of spectacular shape drawing tools, brushes and effects that simply do not exist in any modern paint program- Particularly not whilst staying within the "bounds" of a low color palette indexed image. I would like to ...

How do I draw a dotted line from the paint method on a JComponent?

Hey I have to draw a dotted or dashed line In a JComponent. How do I do that? ...

Call repaint from another class in java?

Hi all. I'm probably doing this wrong, so please be nice. I'm developing a java game, and I'm at the stage of testing character movement / animation. The "person" can move up down left and right on a grid. The class the grid is drawn in the gamePanel class. The buttons are in the gameControlPanel class. I have a button which spawns a p...

C# DataGridView Vertical Scrollbar doesn't paint correctly with build file.

I have a DataGridView with both horizontal and vertical scrollbars. When running the application within Visual C# using "Start debugging" everything looks fine, but when running the application itself after building it the vertical scrollbar doesn't paint correctly (it's not really visible but there is space taken up as if it should be...

Problem with Painting in Java Swing App in Java 1.6

Hi, I'm working on a Swing application (currently running on Java 1.6 update 11) which has some intermittent paint refresh problems (e.g. there are artifacts etc.). This only happens to some users of our application but not others. After doing some research, I found that setting the property sun.java2d.d3d to false may help and in fact...

How can I split up paint swing method in java?

I'm developing a fair sized hospital simulation game in java. Right now, my pain method is starting to look a little big, and I need a way to split it up into different sections... I have an idea, but I'm not sure if this is the best way. It starts by painting the grass, then the hospital building, then any buildings, then people, then a...

how do I repaint an applet while moving a sprite?

I have a little java applet where I create 2 threads, one thread repaints and the other moves an image from a point to where the user clicks. The problem is that when I call the move function it loops until the image is where the user clicks but it wont repaint until I break out of the loop even though the thread doing the moving and the...

MVVM-pattern for a Paint-like WPF-Application?

Hi girls and guys! I'm currently in the planning phase for a project of mine. I thought about using the MVVM-pattern for my application for testability, maintainability etc. I have only started to get my head around MVVM but there is one thing that I just can't figure out in the context of my planned application. My application aims t...

Java repaint not working correctly

i use the java repaint method , it repaints, but the update is only seen when I either click on the canvas or resize the panel. How can I fix this ? What causes it? ...

SWT update / redraw / layout problem

Hello, I know many people experience this problem, but the solutions I found online do not seem to solve mine. I have a composite that has three buttons. What I want is the following : When I click one button, I want some other button to be grayed out ( setEnabled(false) ) and after a while (after a method execution), I want the button ...

C# How to draw in front of objects?

Hi How do you draw a string that is supposed to be on top of everything else? Right now in my panel i have some user controls in Panel1.Controls. So i added this to the Paint method: Graphics g = Panel1.CreateGraphics(); g.DrawString("BUSTED", new Font("Arial", 20f), new SolidBrush(Color.Black), new PointF(50, 50)); The problem is ...