drawing

How to change the mouse pointer to an Image when clicked on it in c#

寵の児 提交于 2020-01-05 09:23:07
问题 How can i change the mouse pointer to an image when clicked on the image in c#? 回答1: The question is vague/unclear but perhaps you want to change the system cursor (not just your application)? Here is a link to the pinvoke info for SetSystemCursor. Be warned this is considered bad form. 回答2: This MSDN article explains how you would do it with WPF. Just change their drop-down to a OnClick for the image you're interested in. You could likely also hook in to an OnClick event in WinForms too, but

Kivy: understanding widget instances in apps

。_饼干妹妹 提交于 2020-01-05 09:08:47
问题 I'm still warming up to this Kivy stuff, hope you don't mind another question from me! I'm trying to understand scheduled events for some of my widgets. For the sake of context, I want to be able to move nodes onto edges, and have the edges 'snap to' the node. Here is my .kv file: <GraphInterface>: node: graph_node edge: graph_edge GraphNode: id: graph_node center: self.parent.center GraphEdge: id: graph_edge center: 200,200 <GraphNode>: size: 50, 50 canvas: Color: rgba: (root.r,1,1,1)

Kivy: understanding widget instances in apps

落爺英雄遲暮 提交于 2020-01-05 09:08:12
问题 I'm still warming up to this Kivy stuff, hope you don't mind another question from me! I'm trying to understand scheduled events for some of my widgets. For the sake of context, I want to be able to move nodes onto edges, and have the edges 'snap to' the node. Here is my .kv file: <GraphInterface>: node: graph_node edge: graph_edge GraphNode: id: graph_node center: self.parent.center GraphEdge: id: graph_edge center: 200,200 <GraphNode>: size: 50, 50 canvas: Color: rgba: (root.r,1,1,1)

aggdraw cannot load font (no text renderer)

筅森魡賤 提交于 2020-01-05 05:52:34
问题 I've installed aggdraw on OS X 10.8 using Apple's stock Python (2.7.2) using these instructions. Before doing so, I used homebrew to install freetype, and I modified aggdraw's setup.py to point to my freetype installation ( FREETYPE_ROOT = "/usr/local/Cellar/freetype/2.4.10/" on line 32). Despite all of this, when I try to load a font, I get: $ python test.py Traceback (most recent call last): File "test.py", line 9, in <module> font = Font('black', '/Library/Fonts/Georgia.ttf') IOError:

SWT Tree and TreeItem: Remove or change the drawing behavior of the expand/collapse indicator

放肆的年华 提交于 2020-01-05 04:41:10
问题 I'm working in SWT (no JFace), and I'm attempting to customize the behavior of a Tree that I'm using a sidebar. The top-level items in the tree shouldn't be selectable; they're basically headers. Only the children of these items should be selectable. As a result, I would like the UI to behave in a way that indicates this; clicking on one of these top-level items should expand or collapse but shouldn't provide any sort of visual feedback outside of the indicator changing its state and the

how to drag image in a wxpython frame

对着背影说爱祢 提交于 2020-01-04 20:25:38
问题 what is the easiest way to drag an image ( or text) in a wx window ? i need steps or a small example on how to do that. thanx in advance 回答1: Take a look at the PseudoDC example in the wxPython demo. The sample displays some random shapes within the window which you can grab and move around, you should be able to apply the concepts for an image. You can download the win32-docs-demos from here 回答2: Install wxpython demos, there is DragImage demostration in it. 来源: https://stackoverflow.com

how to drag image in a wxpython frame

喜欢而已 提交于 2020-01-04 20:24:34
问题 what is the easiest way to drag an image ( or text) in a wx window ? i need steps or a small example on how to do that. thanx in advance 回答1: Take a look at the PseudoDC example in the wxPython demo. The sample displays some random shapes within the window which you can grab and move around, you should be able to apply the concepts for an image. You can download the win32-docs-demos from here 回答2: Install wxpython demos, there is DragImage demostration in it. 来源: https://stackoverflow.com

A glitch with Edge label offset

雨燕双飞 提交于 2020-01-04 10:38:11
问题 I have peculiar problem when I tried to offset the edge label in my Jung2 network. As shown in figure below the label causes the self loop difficult to see. So I decided to offset the label: vv.getRenderContext().setLabelOffset(20); And the Effect: Offset is effective for all the edges except for the edge that I need: the self loop. Anyone has a solution or a workaround ? EDIT: Does anyone know what the EdgeLabelClosenessTransformer does? And how to use it? This may solve my problem. vv

How to measure the pixel width of the string drawed over Drawing.Bitmap in .NET?

可紊 提交于 2020-01-04 02:47:11
问题 I am generating a .png image that contains a text dynamically written. I need to create the bitmap with the minimum width for file size reasons. How do I do this? 回答1: Use Graphics.MeasureString() to compute the width. 回答2: You can also use TextRenderer for slightly more accuracy. See this article for differences between this and Graphics.MeasureString : http://msdn.microsoft.com/en-us/magazine/cc751527.aspx 来源: https://stackoverflow.com/questions/2555739/how-to-measure-the-pixel-width-of-the

How to reference system.drawing in Visual Studio 2010 Express?

时光毁灭记忆、已成空白 提交于 2020-01-03 19:16:18
问题 I'm somewhat new to this and I am under the impression that to draw a rectangle that I've created, I need to use system.drawing.graphics. Thing is, I get the error "The type or namespace name 'drawing' does not exist in the namespace 'System' (are you missing an assembly reference?)" and when I right click the References folder in the solution explorer, system.drawing is nowhere to be found. So I'm not exactly sure how to move forward in drawing a rectangle. 回答1: Namespace should be available