paint

Paint Drawline Image into Picturebox Image

北战南征 提交于 2019-12-08 08:01:27
In my Form, I have 2 picturebox controls. I loaded a blue background image on pictureBox1 and left pictureBox2 control alone. With the code below I'm able to draw arrows on top of my picturebox1 image. Goal: On my pictureBox1_MouseUp event I want to add all the arrows which I drew on pictureBox1 to pictureBox2 . Issue: The problem is on my pictureBox1_MouseUp event when I wrote pictureBox2.Image = pictureBox1.Image it doesn't add the painted arrow which I drew on pictureBox1. It only adds the pictureBox1 image that I assigned in my form load event. private bool isMoving = false; private Point

Custom Paint handler on a WinForms Control inside a WPF application

人走茶凉 提交于 2019-12-08 06:09:30
问题 I have a WPF application with a Windows Form element hosted inside it, using this method: System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); gMapZoom = new GMap(); gMapZoom.Paint += new PaintEventHandler(gMapZoom_Paint); host.Child = gMapZoom; // gMapZoom is the Windows Form control // Add the interop host control to the Grid // control's collection of child controls. this.grid1.Children.Add(host); However, I'm having problems

Paint Drawline Image into Picturebox Image

徘徊边缘 提交于 2019-12-08 05:45:03
问题 In my Form, I have 2 picturebox controls. I loaded a blue background image on pictureBox1 and left pictureBox2 control alone. With the code below I'm able to draw arrows on top of my picturebox1 image. Goal: On my pictureBox1_MouseUp event I want to add all the arrows which I drew on pictureBox1 to pictureBox2 . Issue: The problem is on my pictureBox1_MouseUp event when I wrote pictureBox2.Image = pictureBox1.Image it doesn't add the painted arrow which I drew on pictureBox1. It only adds the

HTML5 canvas - opacity problem with a paint app

北战南征 提交于 2019-12-08 04:55:12
问题 I'm trying to program a paint application using Canvas. the way it works is by connection lines when the mouse is pressed. when the line is opaque it works well, but when I change the alpha parameter I get a problem. I tried two options: a. The path begins when the mouse is down for the first time and ends when the mouse is up again: every move of the mouse calls the stroke() function. because the line is transparent the beginning of the whole path will become opaque and the end won't,

How to draw text in derived from QHeaderView class

为君一笑 提交于 2019-12-08 04:02:18
问题 I need to draw text in derived from QHeaderView class. But this code does not work. void HeaderView::paintSection(QPainter *painter, const QRect &, int) const { painter->drawText(0, 0, "abcde"); } 回答1: The documentation says: Paints the section specified by the given logicalIndex, using the given painter and rect. That means, you have to use the rect getting as parameter: void HeaderView::paintSection(QPainter *painter, const QRect& rect, int) const { painter->drawText(rect, Qt::AlignCenter,

PaintCode - move object on the path

自闭症网瘾萝莉.ら 提交于 2019-12-08 03:52:37
问题 I would like draw a curved line and attach an object to it. Is it possible to create fraction (from 0.0 to 1.0) which makes move my object on the path? When fraction is 0 then object is on the beginning, when 0.5 is on half way and finally when is on 1.0 it is at the end. Of course i want a curved path, not a straight line :) Is it possible to do in PaintCode? 回答1: If you need it only as a progress bar , it is possible in PaintCode. The trick is to use dashed stroke with very large Gap and

Android Paint PorterDuff.Mode.CLEAR drawing black color on my view

一个人想着一个人 提交于 2019-12-08 01:54:49
问题 I want to implement eraser for my painting app . I am able to erase with the following code paint.setColor(0x00000000); paint.setAlpha(0x00); But after erasing when you start painting again it does not paint properly so any idea to erase paint please suggest. 回答1: Try the below code. paint.setAlpha(0xFF);//transperent color paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));//clear the draw Also have a look at the sample FingerPaint.java in the api demos under the folder

How do I let multiple Threads paint onto an AWT component?

做~自己de王妃 提交于 2019-12-08 01:18:33
问题 EDIT: solved, look below for my solution. first of all, this is my very first question here, so if I make any mistakes, please tell me. I am trying to write a Mandelbrot Fractal Program in Java, for training purposes. The ideal for all the functionality I want to have is the Fractalizer (http://www.fractalizer.de/en/), but for now, I will be happy with a program that draws the Mandelbrot Set on the screen (instead of, for example, writing it to an image file). Of course, I want the program to

Java Swing: Clearing custom painting from a JPanel overlayed with other JPanels in a JLayeredPane

被刻印的时光 ゝ 提交于 2019-12-08 00:44:23
问题 I've got a JLayeredPane containing three JPanels, two of which overlap, that I'm painting shapes to. One of the two JPanels that overlap needs to have every shape drawn to it cleared without affecting the shapes drawn to the JPanel under it disappear from the screen. Currently I'm using something like this: Graphics g = pane2.getGraphics(); g.clearRect (0, 0, 1000, 1000); But this not only clears everything painted to pane2 but also pane1, which is under it. So my question is: Is there any

How to save draw paint with custom view android?

♀尐吖头ヾ 提交于 2019-12-07 22:51:41
问题 I am using following code . and i am getting problem when saving images .i am able to save bitmap but when save bimap it saves also i erased paint also with black color public class FingerPaint extends GraphicsActivity implements ColorPickerDialog.OnColorChangedListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new MyView(this)); mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor