How to create a dashed line rounded rectangle in Flex? - apache-flex

How can I create a rounded rectangle with a dashed line? I've seen several routines that draw their own straight lines, but nothing for rounded rectangles.

There used to be (probably still is) a great AS 2/3 library for this but I can't find it.
This looks pretty promising:
http://blog.alegitimatebusiness.com/2007/11/07/as2-as3-draw-a-dotted-rounded-corner-box/

Related

Creating alert icon with shadow in CSS

i am trying to create the following image using css.... so far i've got this after googling a bit http://jsfiddle.net/w9Zgc/ and i want to make the following shape..
is there any way this can be done... any help would be appreciated.. oh and i would like the shadow to be like the one here... http://jsfiddle.net/w9Zgc/
So I managed to create an icon that renders more or less the same in all current browsers. I had to use an extra useless span, unfortunately.
http://codepen.io/myajouri/full/nJDzl
The triangle is made of two parts:
the upper (triangular) part is a transformed (skewed and rotated) square with rounded corners.
the bottom of the triangle is the bottom part of a rectangle with rounded corners.
Both parts are cut and joint at certain places to form the triangular shape with rounded corners and shadows.

How does Qt draw a border around a rectangle?

I want to know how Qt does a border when using QPainter's drawRect. The reason for this is I am trying to draw three rectangles next to each other, but I'm having trouble getting them to touch perfectly at all pen sizes.
QPainter's documentation for drawRect says:
A stroked rectangle has a size of [the input rectangle] plus the pen width.
So it goes like this:
I just wanted to add to the answer and address the question about truncation.
Truncation might be happening because you are using the QRect and not QRectF. QRectF gives you floating point precision. Similarly, you can use QPen::setWidthF(qreal width) to ensure your border is not getting truncated either.

Draw rectangle with dashed border in flex?

Draw rectangle with dashed border in flex ?
There is no built-in method for this in the drawing API unfortunately. You can Google for some workarounds like this one:
http://www.getw3help.com/2009/10/dashed-rectangle-border-in-flash.html
Hopefully helps,
Rob
Personally, if you're using Flex4, I would create a new Skin for whichever component you're trying to style (or just BorderContainer if you just want a blank rectangle). And from within the skin, I would pogrammically add the 4 dashed lines.

How to avoid Alias when rotate the image in gdi+?

I have a problem on roating an Image on a canvas in gdi+, I am using the following code, however I find there are alias on the edge.
myPathMatrix.Rotate(GetDCAngle(), MatrixOrderAppend);
myPathMatrix.Translate(
GetDCX(),
GetDCY(),
MatrixOrderAppend);
canvas->SetTransform(&myPathMatrix);
canvas->Draw(XXX);
I used the following code to remove the alias, but failed.
canvas->SetInterpolationMode(InterpolationMode::InterpolationModeHighQualityBicubic);
canvas->SetSmoothingMode(SmoothingModeAntiAlias);
How can I remove the alias at rotated image's edges.
Many thanks!
It's been a while since I worked with GDI+, but I'd assume there's no effective option to remove antialiasing around the edges when rotating. The reason is basically that pixels are square. To rotate an image an amount other than a multiple of 90 degrees, you need to use some kind of interpolation to estimate pixel colours where there weren't really pixels before.
So if there's nothing in the library to specifically take away antialiasing around the edges, have you thought about drawing hard lines in the background colour along the borders? It should be easier to draw those lines without any antialiasing.

Flex: Points to pixels and back again

So I have extended the PlotChart that comes with Flex to have the ability to draw trend-lines. To do this, I have to get pixel positions. How can I convert (100px,100px) in pixels to a point on the graph, such as (0.7,1.0)?
You can draw on charts using the CartesianChartCanvas, here is the link to the LiveDoc: Drawing on Chart Controls
To answer your question more specifically, CartesianChartCanvas supports drawing by pixels.
You probably want to create a subclass of ChartElement, and add it to annotationElements for your chart. The docs for Flex 2 show an example: Livedocs
PlotSeries::dataToLocal(...) ended up working fine.

Resources