drawing

visual styles independent drawing

蹲街弑〆低调 提交于 2020-01-03 17:27:54
问题 Using C# winforms, i want to create custom controls that looks like the real ones. There are a lot of classes that can be used to draw controls that looks like the real ones: ControlPaint , VisualStyleRenderer , ButtonRenderer , CheckBoxRenderer , ComboBoxRenderer , GroupBoxRenderer , ProgressBarRenderer , RadioButtonRenderer , ScrollBarRenderer , TabRenderer , TextBoxRenderer , TextRenderer , ToolStripProfessionalRenderer , ToolStripRenderer , ToolStripSystemRenderer , TrackBarRenderer . The

Unprecise rendering of huge WPF visuals - any solutions?

左心房为你撑大大i 提交于 2020-01-03 17:19:32
问题 When rendering huge visuals in WPF, the visual gets distorted and more distorted with increasing coordinates. I assume that it has something to do with the floating point data types used in the render pipeline, but I'm not completely sure. Either way, I'm searching for a practical solution to solve the problem. To demonstrate what I'm talking about, I created a sample application which just contains a custom control embedded in a ScrollViewer that draws a sine curve. You can see here that the

Drawing line to link treeview node of one treeview to treeview node of another treeview

一笑奈何 提交于 2020-01-03 06:41:10
问题 How is it possible to draw a line to link treeview node to another treeview node link should be shown in from 回答1: In WinForms TreeViews are special. For one they don't have a Paint event, so it is not possible to draw on them. (You can subclass them though, see the update below..!) Secondly you can't nest a transparent control in them. You can nest it but it won't be transparent..) So drawing onto the TreeView seems to be imposible. But maybe it is not what you want anyway..? Let's instead

Retrieving percentage of colors of a MovieClip

时光总嘲笑我的痴心妄想 提交于 2020-01-03 04:48:07
问题 today my question is as follows: I have a game, and one of the phases is that you have to pass a "protective cream" on the doll's body. I already have this effect (image below), I'm using an alpha filter combined with a mask that is drawn. I wonder how can I do to be checking after 20 seconds of the game, if the user has filled 100% of the masks ... My code is this (forgive me, I am beginner and Brazilian ... any questions ask me): stop(); import flash.display.Shape; import flash.events.Event

Winform not scrolling when drawing objects on it

旧时模样 提交于 2020-01-03 04:46:12
问题 C#3.0,.net framework 3.5 I am drawing ( using the draw method in the graphics class) a lot of solid rectangles on a windows form vertically. The form starts at 500 x 500 px and the rectangles are only drawn at runtime after data is downloaded from the net -and the number of rectangles depends on the download so I do not know it upfront. So only a few rectangles are drawn as the size of the form is fixed. So I googled/Binged ( lest someone suggest I do that) and found a few tips but they don't

Draw rectangle on mouse click [Python]

旧街凉风 提交于 2020-01-03 03:45:05
问题 def xaxis(event): x1, y1 = (event.x - 1), (event.y - 1) def yaxis(event): x2, y2 = (event.x + 1), (event.y + 1) def create(event): w.create_rectangle(x1,y1,x2,y2,fill='Black') w = Canvas(root, width=canvas_width, height=canvas_height) w.config(cursor='cross') w.pack(expand=YES, fill=BOTH) w.bind("<Button-1>", xaxis) w.bind("<ButtonRelease-1>", yaxis) w.bind("<ButtonRelease-1>", create) The shell says Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks

Smooth Drawing with Apple Pencil - some points out of order

隐身守侯 提交于 2020-01-03 02:26:11
问题 Following this Answer, I have implemented a CanvasView to draw with the Apple Pencil: https://stackoverflow.com/a/34583708/2529173 import Foundation import UIKit class CanvasView: UIView { var points: [CGPoint]? var path: UIBezierPath? var pathLayer: CAShapeLayer! override func layoutSubviews() { } override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { pathLayer = CAShapeLayer() pathLayer.fillColor = UIColor.clear.cgColor pathLayer.strokeColor = UIColor.red.cgColor

iOS - Fill bezierPath with multiple colors based on percentage

旧城冷巷雨未停 提交于 2020-01-03 02:25:05
问题 I drawed a UIBezierPath in Objective-C and fill it with a red color. Now, I want to fill the path with multiple colors based on percentage. For example: I want to fill the path with 20% green color and the remaining 80% with red color, on top of each other (not a gradient). I also want a few pixels spacing between the fill and the stroke. I don't know how I can accomplish these things. Does anyone know how I can accomplish this or point me in the right direction? Many thanks in advance!

Android fill in part of a path?

戏子无情 提交于 2020-01-02 22:11:14
问题 I have a shape that I'm drawing with a path. I'm filling that shape in with a gradient and then I need to put another gray area ontop of that gradient dependent upon a %. I'm using path.quadTo to make my shape so I don't know the y coordinate of the top line to properly intersect it. This is what I'm getting when I just set it to the maximum y: The white stroke is the image I'm trying to partially fill in. The right gray area I want to keep, but I need to get rid of the left gray area. Any

Octave : How to change line color and width in drawRect

只谈情不闲聊 提交于 2020-01-02 22:00:25
问题 :-) Hi, guys. Is there any way to change the line color and width of function drawRect in Octave ? According to its reference, there's no property-value pair to set in this function. Thanks. 回答1: The drawRect function does not accept a property-value pair, but it does return a graphics handle from where you can set any property: r = drawRect (x, y, w, h); set (r, "color", [1 0 0]); # set to red (RGB triplets) set (r, "linewidth", 5); Use get (r) to see a list of all properties, or read the