drawing

[FLEX] difference between <s:Line> and graphics.lineTo()

If I skin a button and use the AS3 graphice.clear() and graphics.lineTo and beginFill to create a shape, the button overlaps other items in the container. When I use the and mxml to create the same shape, the button is neatly positioned inside the container. Why is that? ...

Draw parallel lines along a path - PHP GD

I need to draw something like a subway map (multiple routes along the same path) using PHP's image library. Here's an example: ********* ******** * ******* * * * * * * * * * * * * * * * * * * * * * * * ...

How to implement sineWaveTo squareWaveTo and sawWaveTo lines in html5 canvas 2d context?

I would like to try an implement these so that they can be used in a manner similar to lineTo(). Starting from the current point, given the ending coordinates the functions would draw either a square, saw, or sine line all the way to the the ending coordinates. I dont know if we can factor in both Amplitude AND Frequency because I guess...

draw a radar / spider diagram on the iPhone (sdk)

I'm trying to find a class or a tutorial so I can create a radar diagram (spider diagram) for my iphone and iPad app. Is there anything you guys know of? I've found some classes on google.code and github but these don't contain the spider diagram I require. any ideas? (I am open to the idea I may have to write my own class - but I've no...

Scaling/Translating a Shape to a given Rectangle using AffineTransform

Hi all, I'm trying to scale/translate a java.awt.Shape with AffineTransform in order to draw it in a defined bounding Rectangle. Moreover, I want to paint it in a drawing Area having a 'zoom' parameter. I tried various concatenations of AffineTransform but I couldn't find the correct sequence. For example, the following solution was w...

UIView CGGradient clipped to drawn "frame"

Hi all! I'm trying to make a more sophisticated drawing of a UILabels (or a UIView, putting the UILabel on top, should that be required) background. Since I want this to resize automatically when the user changes iPhone orientation, I am trying to implement this in a subclasses drawRect function. I would love to be able to tune this all...

UIView zoom and draw issue

Hi everyone! I have UIView wich have to be zoomed in After zooming i have to draw on this view and then zoom out. And certainly the zoom out picture have to include new drawing in proper size. So the question is -How can i zoom UIView (or maybe i should use UIImageView instead, then the question is how can i draw on UIImageView) -And...

c# drawing image to bigger bitmap

hi, I have create a bitmap. it's width 500px, and height 500px.. And i have an image. it's w : 300px, h:300px; i want to set image to bitmap 500px, 500px without space or black background. Could u help me pls. Ty. ...

RotateFlip - when it is applied?

I'm using RotateFlip to flip sprites horizontally. It seems that RotateFlip is applied when Graphics is drawn not image. The problem is that some sprites needs to be flipped and some not (depending on direction of sprite). I don't want to clone image each time I'm drawing flipped sprite. ...

WPF: Bitmap doesn't show

I want to create some kind of simulation. There will be numerous sprites floating around. Because I think that rendering every frame thousand times the same primitives which make up a sprite, will be slow, I want render them once into a bitmap and then show this sprite every frame. But it doesn't seem to work, the screen stays white. M...

Repeating background image in an NSView.

I am trying to draw a repeating background image in my NSView, I have this till now: // INIT - (id)initWithFrame:(NSRect)frame { if (self = [super initWithFrame:frame]) { self.backgroundImage = [NSImage imageNamed:@"progressBackground.pdf"]; } return self; } // DRAW - (void)drawRect:(NSRect)dirtyRect { // Draw the backgrou...

NSString drawInRect with UILineBreakModeTailTruncation doesn't appear the "..."

I am trying to use this method to draw a string into a custom UITableViewCell. [self.text drawInRect:TEXT_RECT withFont:font lineBreakMode:UILineBreakModeTailTruncation alignment:UITextAlignmentLeft]; The problem is that if the text is too long, the text is actually tail truncate but it doesn't display the "..." If I use the draw...

Where to start if I like to build grid drag and drop drawing area with flex?

Hello all I need to build diagram engine with flex to be able to drag and drop elements to Drawing area , I am beginner with flex but have lots of programming experience Can you please point me to the current links tutorials to build such thing ? ...

Drawing Multiplie Lines in a Buffered Image in Java

Hi everyone: I am trying to draw horizontal and vertical lines on a bufferedimage. It should end up looking like a grid of cells. But when I run the code, I see only two lines: the leftmost line and the topmost line (ie. a line from 0,0 to 0,height of image & 0,0 to width of image,0) Heres the code snippet: BufferedImage mazeImage = ...

How to draw horizontal & vertical lines one pixel wide in Quartz?

Hi, I am having trouble drawing one pixel wide lines. All lines are perfectly horizontal or vertical (I am not drawing diagonal lines) but they do not draw cleanly. It looks like it is drawing across two pixels at a reduced alpha. No doubt due to antialiasing. I've searched the docs and forums and have come across a statement saying that...

How do I draw a background like the nstoolbar

I am trying to make a custom toolbar to use anywhere. I want the background to look like the gray that the nstoolbar has. The color is used in several places like the top of Safari or Mail. Does anyone know of an easy way to draw it? Or use the nstoolbar somewhere other than the top of a window? ...

Scalable video game graphics

I'm looking to make a relatively simple game using solely graphics primitives (Arcs, Lines, Polygons, etc.). I started doing this in C# by drawing to a Panel, but right now I'm hung up on how all the scaling works in terms of keeping the proportions the same when changing resolutions. Does anyone have any advice and / or tips on how to ...

C# drawing disappears (actually more system question)

Hi, OK, I am sure some of you already know whats happening just by my title, since I get this is very common question. But my question is in fact little deeper, so please be patient wíth me. All my programing I have done in past years were in Assembler, mainly 8051 and AVR as weel as in C, but also for microcontrollers. I was more fasci...

[Quartz2d] Drawing to a bitmap context

I am trying to draw to a bitmap context but coming up empty. I believe I'm creating things properly because I can initialize the context, draw a few things, then create an image from it and draw that image. What I cannot do is, after initialization, trigger further drawing on the context that draws more items on it. I'm not sure if I'm...

With jQuery, how to draw square Divs inside the document, clicking a point in the viewport then moving the mouse?

Hi to all, I want to draw inside the DOM squared Divs, clicking a random point in the viewport then moving the mouse with this effect... http://www.vegabit.com/test/example_create_div_on_mouse_move.jpg in jQuery... and without any plugin... Thank You in advance! Max ...