drawing

Resize line from endpoints

不问归期 提交于 2019-12-22 13:49:19
问题 I am drawing annotations on a view. The line annotation is causing a problem; I have a parent class of Shape (extended from UIView). All the annotations are subclass of shape. In each annotation class i have override the drawRect method. DrawingCanvas class (extended from UIView and is a subview of my viewController's parent view) handles the pan gesture. Here is a piece of code -(void) panGestureRecognizer: (UIPanGestureRecognizer *) panGesture { static CGPoint initialPoint; CGPoint

Win32 Text Drawing Puzzle

巧了我就是萌 提交于 2019-12-22 13:49:10
问题 I've got a little text drawing puzzle under Win32. I'm trying to draw some instructions for users of my application at the top of the window. Please refer to the following window (I've changed the background color on the text so you can see the boundaries) (source: billy-oneal.com) I'm currently using DrawTextEx to draw the text to my window, but the problem is that it does not fill the entire RECTangle that I give it. Not drawing that area is just fine, until the window resizes: (source:

Draw countdown circles

血红的双手。 提交于 2019-12-22 10:26:28
问题 I would like to draw, in a ViewController, a countdown like in the following image: Unfortunately, I don't have any idea on how to realize this. I will be please if someone could give me a clue on this. Cheers. Cyril 回答1: A quick thought, I would not like to draw it by using any iOS frameworks :), Just use small UIWebView and run javascript(Only works if user enables javascript, but hey I have seen no one yet who doesn't use javascript). Javascript polar time can be found on internet, open

In CoreGraphics drawing how can I keep the point of overlap from being darker than the rest of the line?

拟墨画扇 提交于 2019-12-22 09:02:05
问题 My app uses core graphics for custom finger paint drawing. I allow the user to change the alpha of the line and a new line is continuously drawn on touches moved. When I make the alpha lower than 1.0 the point of overlap is darker than the rest of the line. I know why this occurs but how can I stop this? 回答1: I suppose you want a single stroke not to darken itself, but still to darken previous strokes (that's how most painting apps work). For this to work, you need two views/buffers, one for

How to know when a control (or window) has been rendered (drawn) in WPF?

丶灬走出姿态 提交于 2019-12-22 08:37:42
问题 I need to store the content of a Window into an image, save it and close the window. If I close the window on the Loaded event the image contains the Window with some items are drawn ok, some others are only half drawn or distorted while others are not on the image. If I put a timer and close the window after a certain amount of time (something between 250ms and 1sec depending on the complexity of the window) the images are all ok. Looks like the window needs some time to completely render

Drawing onto canvas% element

我是研究僧i 提交于 2019-12-22 06:56:01
问题 I have a problem while trying to draw onto a canvas GUI element. I create a frame, a canvas and try to draw on the dc context of the canvas with the draw-line method, but nothing happens. The frame with the canvas is shown, but the line isn't shown on the canvas. (require racket/gui/base) (define frame (new frame% [label "Frame"] [width 500] [height 500])) (define canvas (new canvas% [parent frame])) (define dc (send canvas get-dc)) (send dc draw-line 10 10 200 200) (send frame show #t) Does

Things you can draw with HTML tables

浪尽此生 提交于 2019-12-22 06:49:24
问题 So I was watching a talk by Google's Marissa Mayer about speeding up Google's pages. They found that a shopping cart icon increased load time by 2%, and users then searched 2% less. They managed to replace the icon with an HTML table. Here is my attempt at drawing a shopping cart: (live example page) <html> <head> <style> table {border-collapse: collapse;} th, td {width: 8px; height: 8px;} th {background-color: blue;} td {background-color: white;} </style> </head> <body> <table> <!-- this row

How to draw an animated path with multiple colors in ios?

情到浓时终转凉″ 提交于 2019-12-22 05:05:49
问题 I need to draw something like the following image in my iOS app, except that the arc may contain more colors: I know how to draw it, but I'm looking for a way to animate the drawing of the path. There is a similar question here, except that the circle is not animated. This is another question where it's explained how to animate a circle, and it work ok in my case, except that it doesn't handle multiple colors in the path. How can accomplish this? 回答1: I found a general solution that work very

Drawing a grid of images with WPF

℡╲_俬逩灬. 提交于 2019-12-22 04:45:15
问题 I'm trying to draw a grid of images/icons with WPF. The grid dimensions will vary but will typically range from 10x10 to 200x200. The user should be able to click on cells, and some cells will need to update (change image) 10-20 times per second. The grid should be able to grow and shrink in all four directions, and it should be able to switch to a different "slice" of the 3D structure it represents. My goal is to find a suitably efficient method for drawing the grid given those requirements.

Assigning a delegate to a CALayer's sublayer throws EXC_BAD_ACCESS?

风流意气都作罢 提交于 2019-12-22 04:44:23
问题 I'm trying to use a series of CALayers as sublayers to a view that needs a little more fine grained drawing than usual. I've been using CATiledLayer before, and I thought using sublayers would be easier, if not equally finicky. I figured I perform a [self.layer addSublayer:sublayer] , set the delegate of that new sublayer and then I draw all I want in the drawLayer:inContext: method. But to my great surprise, my app crashes on addSubview: (without IB) or somewhere higher up the call stack