paint

How to prevent Android's drawBitmap from only drawing black images?

As per the original question, The end result is a rounded-rect png in an ImageView with a natural looking drop shadow. I have the shadow working, but when it draws, it makes the entire image black. How can I prevent the original image (definitely not black) from being black when adding the shadow? BlurMaskFilter blurFilter = new...

image too sharp when zoomed out

I have a zoomable/scrollable image that is of high quality. When i zoom out, the image looks way too sharp. Is there a way to blur the image out a bit so i can code it to blur when it reaches a certain zoom level or is there a better way to go about this? For now i actually have a lower res version of my image that loads when the user hi...

scroll vs. paint

I'm stuck on the following: I'd like to be able to paint into a view within a UIScrollView and still allow scrolling. I've seen it done in one program. Two fingers down and you can pinch zoom and scroll. One finger down and you draw. If delaysContentTouches=NO, I'm having a very difficult time detecting when two fingers are down reliabl...

How to draw on the Parent control from inside the UserControl

Hi all, The Graphics object in UserControl.Paint event makes sure that contents are drawn within the boundary of the user control. I guess the same graphics object is used to draw the entire window (by passing different clipping regions for different controls inside the form). My question is, is there a trick/hack with which, the Paren...

Creating a thumbnail of a jEditorPane, the text is not rendered

I am trying to create a list where thumbnails are shown for a jEditorPane - similar to how in powerpoint you can see a preview of each slide. However, for some reason the images and backgrounds in my editorpane are rendered but the text is not. Some example code: private void createThumbNailView(javax.swing.event.TreeSelectionEvent evt)...

Why is my c# paint method running out of memory?

I'm new to c#, and trying to learn by writing some simple apps to get familiar with the syntax and .NET library. The most recent miniproject I took on is a polar clock like the one found here. One of the problems I noticed early on was that the app would constantly "flicker", which really took away from the presentation, so I read onli...

Hooking into Forms redrawing

I'm looking for a way to overlay the graphical output of a third-party application with some lines, arcs etc. The applications accepts a handle of a window in which it will then display its output. Using VC++ I put together a Windows Forms app in Visual Studio that draws (non-static) stuff in the onPaint-method of a form. Passing this f...

Java: Composite

Hi, I'm implementing a diagram that shows the level of a container. Depending on the fill level, the colour of the line should change (for instance, close to the maximum it should show red). Rather than calculating different segments of the line and setting their colours manually, I'd like to define a band in which the colour automatica...

Java Window paint problem

Hi, My application does not paint itself on startup. When resizing it or minimizing/maximizing it, the window of the application is painted. This problem only appears on Windows machines (I tested XP, Vista and Windows 7). On Mac OS X and Linux, the application works fine. The machines have installed java 6. My application uses the AW...

Toast Immediately

I would like to have a Toast Message appear while my app is downloading information but even if I put it before my code it doesn't appear until after the download has completed. Putting my code in a separate thread causes many headaches but putting toast in a separate thread doesn't work either. Is there anyway I can have this Toast me...

Disable OnPaintBackground without subclassing Panel?

Is there any way to disable the erasing of a panel without subclassing Panel and overriding OnPaintBackground? I am trying to achieve a double buffering effect without subclassing Panel. I understand that this may be a weird thing to try to do, but I'd at least like to know if I can or not. The following code sample illustrates this: p...

Form not refreshing after ShowDialog (Compact Framework)

Hi, I'm having a weird issue with form painting in the Compact Framework. I have a login dialog that is basically a small form that is opened on top of another using ShowDialog. When a card is swiped, the login dialog is supposed to close, then some login tasks are performed and then the form behind it should be activated. The problem is...

Java - Paint, JFrame, and Backgrounds

I'm trying to paint a Welcome Screen for my game, but only when the game loads. I don't want it to repaint everytime during the game. So I did this (where isStart is instantiated as true): public myClass(String name){ setSize(800, 800); setVisible(true); setResizable(false); runGame() } public void paint(Graphics g) { ...

Speeding Up TableLayoutPanel Painting?

Stack-O, I have a TableLayoutPanel with 50 rows and 6 columns. That's all well and good, but whenever I move or resize my WinForm, it takes about 15 seconds for the TableLayoutPanel to repaint. How can I speed this up? ...

Do I need to restore the Graphics state after painting in my OnPaint override (for a .NET Control)

Consider the following overriden OnPaint method for a .NET Control: protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.RotateTransform(180); // lots of drawing code } Is it a problem that I do not restore the state of the e.Graphics object when I am finished? In Java this is often done by making...

Custom UI painting problem

I have a JInternalFrame that I am applying a custom UI to. The UI paints the component, but when I add a JPanel to the JInternalFrame it doesn't show up. I think the UI is paining over the whole component, but how do I paint the UI THEN paint the components? But if anyone has a better way of doing this, please let me know! Thanks! publ...

How to change the background of an image in iPhone app?

Hi, I'm in the process of creating an app and I want to include a color palette where the user can pick a color and apply the color to the background of an image (i.e. change the color of the walls of a furnished room). I've tried google for viable solutions to this but am stumped. Any ideas of how I can go about implementing this? I ran...

Clear painted screen at each click of the mouse?

Can't seem to figure out how to only show one circle. Was trying to //g.clearRect(0, 0, 400, 400); but that clears the background too. Was also trying to just fill the background with yellow again but couldn't get that working either. Any suggestions? import javax.swing.*; import java.awt.*; import java.awt.event.*; public class JMous...

Java AWT Heavyweight Canvas

Hi, I have an applet where I am drawing stuff by overriding the paint() method, and have added a Canvas to the applet, which will take up the whole screen. This canvas seems to be being drawn after my paint()ing, and so my applet's paint()ed stuff is invisible. Any ideas on how to force the canvas to be drawn before my paint method on my...

Delphi 6 : Detect when a Form is fully painted?

Is there a simple and convenient way to tell when all the Components, Frames, and Child Controls on a TForm are fully painted? I'm basically looking for the equivalent of the onload() event found in web pages but in the context of Delphi forms. Preferably this technique would still work even if some form elements aren't currently visib...