drawing

Draw a (progressive) paint splash on a canvas

给你一囗甜甜゛ 提交于 2019-12-20 10:44:39
问题 I'm looking for a simple method which can able me to draw in a canvas a paint splash like this on : One method will be to fire a lot of small particles which will paint a little circle, but I don't want to manage a lot of particle objects. EDIT : example here: jsfiddle.net/MK73j/4/ A second method will be to have few images and manipulate scale and rotation , but I want to have a good random on the effect. A third method will be to make some random litte points, join them with bezier curves

How do I create a blurred-glass effect on a border-less Form?

安稳与你 提交于 2019-12-20 09:38:16
问题 How do I draw a smooth blurred-glass effect on a border-less Form? I have tried the code listed on Image Processing for Dummies with C and GDI+ page but I'm sure it's not what I should be using. No amount of playing around with it has yielded any kind of result that is what I'm after. This is basically what I'm trying to achieve: 回答1: I'll assume you are talking about Windows 7 / Vista, and you'd like to achieve the blurry transparent areas that some MS programs have in the same way. For the

Curvilinear perspective: Convert 3D to 2D

寵の児 提交于 2019-12-20 09:37:41
问题 I'm looking for the mathematical expression converting a 3D coordinate (x0,y0,z0) to a 2D (x1,y1) coordinate in a curvilinear perspective of radius R where the values of x1 and y1 are the angles of views {-90° .. +90°} of the original point. (source: ntua.gr) (image via http://www.ntua.gr/arch/geometry/mbk/histor.htm ) Thanks ! 回答1: About one year later , the solution was really simple. For a point having the coordinates: (x1,y1,z1) Then, to transform this point in a curvilinear drawing of

Drawing box around message

梦想与她 提交于 2019-12-20 08:06:32
问题 I'm working on this Python task that I can't figure out. It is the last of 3 functions and the first 2 were much easier to program then this one. The instructions are "Given a message that may contain multiple lines, utilize the split() function to identify the individual lines, and the format() function so that when printed, it draws a box around the message's lines, all centered. Box uses vertical bars & dashes on the sides (|, -), +'s in the corners (+), and there is always a column of

How to use CgLayer for optimal drawing

前提是你 提交于 2019-12-20 07:25:59
问题 I have created a simple drawing project,the code works fine, but I want to cache the drawing into CGlayer, because I read that its more efficient way in drawing . I have read through the documents, but not able to understand it properly. So friends, I request you to please help me in this regard. Below is my code, I want to know how to use CgLayer in this - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); if(myLayerRef == nil) { myLayerRef =

Draw a “L” using the DrawingContext

自闭症网瘾萝莉.ら 提交于 2019-12-20 06:14:12
问题 I need to Draw (using System.Windows.Media.DrawingContext ) a " L " in WPF. What is the optimal way to proceed? Draw 2 lines? Draw a PolyLineSegment ? (not sure how) drawContext.DrawLine(myPen, topLeft, New Point(topLeft.X + 5, topLeft.Y)) drawContext.DrawLine(myPen, topLeft, New Point(topLeft.X, topLeft.Y + 5)) Actually, I need to surround a label with visible corners "L"-like... I need to draw , not to use Templates or Decorators. 回答1: If your question is about adding as few as possible

SWT Tree - Lowering the native expand icon possible?

我的未来我决定 提交于 2019-12-20 05:14:15
问题 I have a JFace TreeViewer with a SWT Tree underlaying and I am painting my cells for multiple row support for myself. Currently, it looks like this: I want both the expand icon and the label to be lowered like this: This is no problem for the label because I am extending from StyledCellLabelProvider and am overwriting paint() and measure() - the problem is that I have no clue if its possible to set the Y Coordinate for the Expand Icon. I'm afraid it isn't.. If so, I would like to paint a

python draw multigraph

℡╲_俬逩灬. 提交于 2019-12-20 05:00:36
问题 I try to draw multigraph in Python using graphviz. For now I can draw usual graphs in Python somehow like: import pygraphviz as pgv G=pgv.AGraph() G.add_node('a') G.add_node('b') G.layout() G.add_edge('a','b','first') G.add_edge('a','b','second') sorted(G.edges(keys=True)) G.draw('file.png') And I get on the output: But actually I want get multigraph, i.e. But documentation stays that it should differentiate : I have no idea about drawing multigraph but not just graph. Thanks for any help.

Windows forms and XNA - Draw is not realtime

一个人想着一个人 提交于 2019-12-20 04:25:26
问题 I am currently working on a Level Editor for XNA which is built by combining Windows Forms and XNA. I am using stuff from the example on App Hub link text, but I have made some changes, so I have some ViewportController class which manages all the viewport controls, instead of the form manages them directly. The problem is that when I need to update the Draw method I have to shake the window. Anybody knows how to fix this, so the Draw will update realtime? 回答1: Not sure what a

Adding custom shapes to JTextpane and saved to new Word document

我与影子孤独终老i 提交于 2019-12-20 04:22:45
问题 If I load a Word document into a JTextPane , is there a way I could drop a custom shape in it, then save it as a new Word document? The results I'm looking for are just like dropping a shape anywhere onto the document using Insert-> Shapes in MS Word. 回答1: docx4all is a Swing-based docx editor. Like DocxEditorKit, it is built on top of docx4j. You'd need to extend it to support the functionality you are describing. 回答2: You can try to extend the DocxEditorKit http://java-sl.com/docx_editor