draw

How to draw a NSImage like images in NSButtons (with a deepness)?

我们两清 提交于 2019-11-29 18:53:25
Is there any way to draw an NSImage like images in NSButtons or other cocoa interface elements? Here are examples: Apple uses pdf's with black icons: omz If you simply want this effect to be applied when you use your own images in a button, use [myImage setTemplate:YES] . There is no built-in way to draw images with this effect outside of a button that has the style shown in your screenshots. You can however replicate the effect using Core Graphics. If you look closely, the effect consists of a horizontal gradient, a white drop shadow and a dark inner shadow (the latter is the most difficult).

How can I paint in an specific JPanel when more than one in same frame- Java

让人想犯罪 __ 提交于 2019-11-29 18:37:32
Updated - this is related with the following link I posted yesterday. https://stackoverflow.com/questions/15916360/swing-gui-application-in-java-with-multiple-frames I apologize if I am doing something wrong here, I tried to write in my previous post and I couldn't find a way to do it beyond the comments box. I did some changes on my code, now I am working with 3 JPanels. I created a class for each panel except the main one that will hold in a CardLayout the other two. The main panel is created in my main class and application at the same time. Now I am trying to paint a happy face in one of

drawing your own buffered image on frame

我怕爱的太早我们不能终老 提交于 2019-11-29 15:54:52
I have a buffered image with the sizes of my frame: public BufferedImage img; public static int WIDTH = 800; public static int HEIGHT = 600; img=new BufferedImage(WIDTH, HEIGHT,BufferedImage.TYPE_INT_RGB); How can I draw it so I can see just a black image filling the frame? without using Canvas I want to use only the drawImage function from graphics without using the paint or paintComponent functions If it is possible, how can i assign an 1D array [WIDTH*HEIGHT] to that image? SIMPLY: I want to create an image ,convert the values from an array to pixels (0=black,999999999=lightblue etc.) and

android, how to draw dotted line in edittext

青春壹個敷衍的年華 提交于 2019-11-29 14:58:39
I refered to this link: How do I make a dotted/dashed line in Android? , and used DashPathEffect . But this does not work for me? why? my code: public class NoteEditText extends EditText { private Paint mPaint; public NoteEditText(Context context) { super(context); } public NoteEditText(Context context, AttributeSet attrs) { super(context, attrs); mPaint = new Paint(); mPaint.setStrokeWidth(1); mPaint.setStyle(Paint.Style.FILL_AND_STROKE); mPaint.setColor(Color.DKGRAY); PathEffect effects = new DashPathEffect(new float[]{5,5,5,5},1); mPaint.setPathEffect(effects); } @Override public void

Android Drawing bitmap and button on canvas by X Y Positions

落花浮王杯 提交于 2019-11-29 12:51:47
i'm new into android and i have some problems with my app. Any help will be appreciated :) I have drawing bitmap on canvas by xpositon and ypostion by sensors (when i'm moving my phone, bitmaps are moving ) I need to create moving clickable button on center of my bitmaps and when i click them i will go to next activity . Bitmaps are drawing perfectly but idont know how to draw buttons on them, buttons that will be moving with my bitmap by the same values of x and y. How i can do that? This is my piece of code: private void updateBall() { // Calculate new speed // xVelocity += (xAcceleration *

Android : Zoom Image And Draw line on image with current zoom

不想你离开。 提交于 2019-11-29 11:39:02
I am using ImageView support zooming.Right now I am extending the ImageView so i can draw on canvas . Currently i Have setImageResource setting a drawable and In onDraw(canvas); i am drawing some line over a path then drawing that over the canvas. The problem is when i try zooming, the image zooms perfectly but the drawing that was drawn over the canvas is not zooming. it just stays in place. Steps - First screen Image view - Zoom Imageview. - Now Draw on Image like signature,line,circle etc - Then when zoom out at that time it should be display when you draw object. // Single Tone class

Android draw with blur

那年仲夏 提交于 2019-11-29 10:55:18
问题 I need do draw on Android's Canvas using Blur effect, it is a very simple feature, I need to draw a circular area, which is blurred (the foreground) and the background transparent, I can do everything with manipulating the colour alpha to do it with custom transparency but I need it to be blurred instead of transparent.. any ideas? 回答1: (For those who are coming back, though this is an old question) On the Paint object which you are using to draw the Color, set paint.setMaskFilter(new

how to get coordinates of a polygon in OpenLayers

自古美人都是妖i 提交于 2019-11-29 09:36:49
问题 I have been looking for how to determine coordinates of the points which consist a polygon(feature) in OpenLayers. Let's say I have created a polygon like the one in this example. I need to know the points which consist the polygon, so I can save them somewhere. I bet it is an easy one. I just couldn't find anything, probably I don't know what I should search for. Thanks in advance. 回答1: Found it finally! vectors.features[0].geometry.getVertices() 来源: https://stackoverflow.com/questions

PHP Application Flow Graph (or function call graph)

拥有回忆 提交于 2019-11-29 09:06:55
问题 Happens that I've ended up working on a big PHP program and I need a program (or easy to install script) which draws a flow control/call graph of a PHP application (ie; must work over multiple PHP files). Already saw stuff like Graphviz, not sure which one works for PHP? Any suggestions? Cheers! 回答1: I have never used any tool that can do that statically (i.e. from source files) , but here's a way to get a callgraph when executing a script/application. First, you need to install the Xdebug

Draw lines between 2 elements in html page

▼魔方 西西 提交于 2019-11-29 06:58:12
问题 i need to draw lines between 2 element on html page the results should be like this: http://img2.timg.co.il/forums/1_173873919.JPG i wondered what the best way do this using canvas and html5 using background image. make by ajax dynamic the image i would like to know what the best way and if there is a simple demo on the web thanks 回答1: Lots of ways to solve your need: Here's one solution using an html canvas: http://jsfiddle.net/m1erickson/86f4C/ Example code (could be fully automated with