Questions tagged [paint]

The act of displaying a GUI component on a screen output device

Painting is the act of displaying a GUI component on a screen output device, and is responsible for visually representing the component object to the user. For example, displaying a Button object should paint a 'button' shape on the screen, with the text or icon that relates to the button.

2808 questions
15
votes
5 answers

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…
Johnston
  • 707
  • 2
  • 6
  • 8
15
votes
2 answers

Drawing an overlay on top of an application's window

I want to be able to paint on top of my application's window so that I can annotate all the widgets with some extra diagnostic information, similar to the CSS developer tools in Firefox (eg add widget classes, styles, highlight borders etc). I can…
the_mandrill
  • 29,792
  • 6
  • 64
  • 93
15
votes
3 answers

Android Edit Bitmap Channels

It's possible to access the alpha channel of a given bitmap with extractAlpha(), but I haven't been able to find any way to actually set the alpha channel of a bitmap. How can multiple greyscale images be recombined as channels into a Bitmap with…
Kleptine
  • 5,089
  • 16
  • 58
  • 81
15
votes
6 answers

Smooth window resizing in Windows (using Direct2D 1.1)?

It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and…
d7samurai
  • 3,086
  • 2
  • 30
  • 43
15
votes
4 answers

Re-paint on translucent frame/panel/component.

I'm trying to create a translucent window with Java on OSX and add a JLabel to it. This JLabel changes its text every second.... However the component is not repainting well. How can I solve this problem? I've found the these articles, but I…
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
15
votes
4 answers

Android create layers in canvas

I want to learn how can I create layers (like in photoshop) in my android application. I want to achieve one basic thing: when I add an image in my canvas, which will be some figure for example, I want to be able to paint the canvas, but the…
Android-Droid
  • 14,365
  • 41
  • 114
  • 185
14
votes
5 answers

Reduce Padding Around Text in WinForms Button

I have an application that is going to be used on a touch screen system, and it contains a number of buttons that are fairly large (~100px square). Each button will have between 1 and 4 lines of text (typically one word per line). Due to the large…
Bryan
  • 3,224
  • 9
  • 41
  • 58
14
votes
3 answers

Porting Autodesk Animator Pro to be cross platform

a previous relevant question from me is here Reverse Engineering old paint programs I have set up my base of operations here: http://animatorpro.org wiki coming soon. Okay, so now I have a 300,000 line legacy MSDOS codebase. It's sort of a "be…
Breton
  • 15,401
  • 3
  • 59
  • 76
14
votes
5 answers

Simulating brush strokes for painting application

I'm trying to write an application that can be used to create pictures that look like paintings using simulated brush strokes. Are there any good sources for simple ways of simulating brush strokes? For example, given a list of mouse positions that…
DrRobot
  • 175
  • 1
  • 6
14
votes
2 answers

Difference between paint() and paintcomponent()?

I have tried tutorials on this but I still don't quite understand it. Basically my question is which method is better and why? Should I use paint or paintComponent? Please try to keep the answer simple, thanks.
Boogley Beegly
  • 95
  • 1
  • 3
  • 11
13
votes
3 answers

Flutter draw SVG in CustomPaint (Canvas)

I have something like this: CustomPaint( painter: CurvePainter(), ) In this class I am doing my painting: import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import './myState.dart'; import…
otto
  • 1,815
  • 7
  • 37
  • 63
13
votes
3 answers

Drawing 1-pixel thick, aliased lines in real-time

A brief background: I'm working on a web-based drawing application and one of the tools I'm implementing is a 1-pixel thick pencil. The tool allows the user to draw 1px aliased lines on the canvas. In order to determine where the user is drawing on…
Xenethyl
  • 3,179
  • 21
  • 31
13
votes
1 answer

Different behavior for FillType.EVEN_ODD when adding a CornerPathEffect?

I was experimenting with Drawable here and found something I can't explain and hope someone can help me with. Why does adding a CornerPathEffect to the Paint seems to “break” (?) the EVEN_ODD FillType? To be more specific, I was testing this…
davidcesarino
  • 16,160
  • 16
  • 68
  • 109
13
votes
3 answers

Changing The Underlying Background Color Of A Swing Window

As discussed here, when resizing a Swing application in Vista (and Windows 7, which is what I'm using) you get a black background in the right/bottom corner while Swing's repaint catches up to the changes. Playing with other applications (Windows…
dimo414
  • 47,227
  • 18
  • 148
  • 244
12
votes
2 answers

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…
Breton
  • 15,401
  • 3
  • 59
  • 76