paint

How to fill different color on same area of imageview (Color over another Color on same area of imageview)?

浪子不回头ぞ 提交于 2019-12-07 22:10:30
问题 I have one imageview and i set image for filling the different colors. But when i fill color then other color is not fill on same area on imageview which previous color is filled. I use color pallet button for getting different color for fill on imageview. Below is my code and image description. public class Play_Screen extends Activity implements OnTouchListener, OnClickListener { private Thread thread; private boolean running = false; // DrawImageView iv; // ImageView imageView; private

How to create Paint-like app with XNA?

≯℡__Kan透↙ 提交于 2019-12-07 16:31:18
问题 The issue of programmatically drawing lines using XNA has been covered here. However, I want to allow a user to draw on a canvas as one would with a drawing app such as MS Paint. This of course requires each x and/or y coordinate change in the mouse pointer position to result in another "dot" of the line being drawn on the canvas in the crayon color in real time. In the mouse move event, what XNA API considerations come into play in order to draw the line point by point? Literally, of course,

Android, drawing from the main activity

梦想与她 提交于 2019-12-07 13:08:01
问题 I have a custom view called DrawView created in the main activity. I have implemented the onDraw() method in the DrawView class and it initially draws a circle. I have then added a touch listener, so that when a user clicks, it then draws a square. I am up to the part where the user clicks and a square is drawn. I'm not to sure how to go about this. public class TestActivity extends Activity { DrawView drawing; /** Called when the activity is first created. */ @Override public void onCreate

Canvas object is not displaying, but location is updating correctly in Java Applet

安稳与你 提交于 2019-12-07 12:19:14
问题 My basic bouncing ball Applet should have a ball moving around according to the values in loc variable, but nothing shows up. Printing out loc shows that the numbers/math behind moving it around and bouncing off boundaries is indeed working as it should, but nothing shows up. Looking at examples online I didn't see why my drawing/painting code wasn't working as intended. Here's what I have, issues are probably focused about halfway down where the Ball object is. I posted most of the program

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

依然范特西╮ 提交于 2019-12-07 11:43:42
问题 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 online about how to implement a double buffer, which eliminated this problem, but may or may not have something to do with the problem. Here is my onPaint method;

Java 1.5 JOptionPane paint bug when using panel message/workaround?

纵然是瞬间 提交于 2019-12-07 09:26:30
问题 I have a JOptionPane with a custom message panel in it, in an application targeted for Java 1.5. The panel contains, among other things, a JTextField. Every 20 invocations or so, nothing in the dialog gets painted (not even the OK/Cancel buttons). If I drag the dialog off the screen and back again to force a repaint, the components are visible as expected, and apart from the painting problem, the components respond fine. Here is the smallest example I could get to exhibit this bug: public

Paintbrush stroke in JavaFX

≯℡__Kan透↙ 提交于 2019-12-07 08:20:48
问题 I'm trying to write a painting application in JavaFX. I want a brush resembling a real paintbrush, but I'm not sure how to start the algorithm. The code below shows my current paintbrush stroke, although it's a useful stroke, it's not really a paintbrush: import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.canvas.Canvas; import javafx.scene.canvas.GraphicsContext; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color

Meaning of some Paint constants in Android

╄→гoц情女王★ 提交于 2019-12-07 05:04:38
问题 There are a few Paint constant in Android about which I couldn't find much info. Could anyone help me with a bit of explanation about those flags: LINEAR_TEXT_FLAG SUBPIXEL_TEXT_FLAG FILTER_BITMAP_FLAG Is 'subpixel' mode something close to ClearType or is it something altogether different? 回答1: SUBPIXEL is indeed for sub-pixel antialiasing, which is currently not supported on Android. Setting this flag will have no effect. FILTER_BITMAP is used to apply bilinear filtering to bitmaps when they

C# Invalidate is not calling paint method

此生再无相见时 提交于 2019-12-07 03:19:28
问题 I have OnPaint method overrided to draw an Ellipse on the screen. protected override void OnPaint(PaintEventArgs e) { MessageBox.Show("Paint"); if (debugStarted) { int y = rtbLogicCode.PlaceToPoint(new Place(0, debugLine)).Y; if (rtbLogicCode.GetVisibleState(debugLine).ToString() == "Visible") { e.Graphics.FillEllipse(new LinearGradientBrush(new Rectangle(0, y, 15, 15), Color.LightPink, Color.Red, 45), 0, y, 15, 15); } base.OnPaint(e); } } private void rtbLogicCode_Scroll(object sender,

Android Paint setShadowLayer() ignores color of its Paint

Deadly 提交于 2019-12-06 21:24:04
问题 I'm trying to create a Bitmap programmatically and am finding drawing a shadowed Rect is ignoring the color arg passed in. I've simplified things down to this case - the code just draws a rotated blue square which is supposed to have a grey shadow, but the shadow is always blue: main.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill