draw

[Excel][VBA] How to draw a line in a graph?

隐身守侯 提交于 2019-12-10 14:17:44
问题 Please view this image to get my clearly question: 回答1: Sub Tester() Dim s, d d = #4/18/2011# * 1 ''a bit of a hack, since I could figure out how to plot a date directly With ActiveSheet.ChartObjects("Chart 1").Chart 'adjust to suit Set s = .SeriesCollection.NewSeries() With s .Name = "" .XValues = Array(d, d) .Values = Array(90, 0) .MarkerStyle = xlMarkerStyleNone .Border.Color = vbRed End With End With End Sub 回答2: Excellll's answer is incomplete. If you simply add this data to what is

How to slowly draw a line in Python

三世轮回 提交于 2019-12-10 12:59:37
问题 I want to slowly draw a line in python so the act of drawing is actually visible to the naked eye. I tried making it by putting it in a loop and increasing the distance each time but i never had any success with it. The thing is nothing would appear for 3 sec and then the whole line would appear which is the opposite of what i want to accomplish. I didn't have success with a pygame.display.delay() function either. The only thing that kind of worked is having clock.tick set to some abysmal

Generating color gradient in Python

笑着哭i 提交于 2019-12-10 12:14:34
问题 i have a list of RGB colors and need to draw gradient between them in python. Have you any suggestions how to make it usin PIL library? EDIT: I get this: def gradient(list_of_colors): width = 600 height = 480 img = Image.new("RGB", (width, height)) draw = ImageDraw.Draw(img) for i in range(len(list_of_colors)): r1,g1,b1 = list_of_colors[i] for x in range(width/len(list_of_colors)): colour = (r1,g1,b1) draw.line((x+(width/len(list_of_colors)*i), 0, x+(width/len(list_of_colors)*i), height),

How to draw a dot on the zoomable bitmap by taking x, y coordinates form its image view

不打扰是莪最后的温柔 提交于 2019-12-10 12:05:39
问题 Please help me I'm developing an android application to display a pinch zoom-able and drag-able bit map in a image view(Image view's boundaries are same as device screen size). I'm only zooming the bit map and show it in the image view What I want is When click a place on the device screen get that X an Y positions and draw a dot exactly in the place where I clicked on the bitmap Its like marking your location on the bit map Here is a descriptive image (Sorry I couldn't upload it to here

Java: Perform Action Every X Seconds

蹲街弑〆低调 提交于 2019-12-10 11:44:58
问题 I've got a working Java program and I would like to draw an object on the display every X seconds. What is the best way to do this? I was thinking of using a for loop and some sleep statements, but I'm curious if there is an easier or more efficient way to go about this. Thanks. 回答1: The simplest way would be to use a javax.swing.Timer Timer timer = new Timer(X, new ActionListener() { public void actionPerformed(ActionEvent evt) { // Update the variables you need... repaint(); } }); timer

values not correctly rendered in line chart in extjs?

£可爱£侵袭症+ 提交于 2019-12-10 11:36:40
问题 I'm having trouble with result rendered by line chart example from extjs4 the columns are rendered correctly but the line is not, notice in the picture how i need to have 4 while its drawed in the 0 xpoint also the second plot is supposed to be 5 when its draw in 2: here is my code: panel3 = Ext.create('widget.panel', { width: 600, height: 200, frame: false, renderTo: 'line', layout: 'fit', items: { xtype: 'chart', animate: false, store: storeline, insetPadding: 20, gradients: [{ angle: 90,

Android - User paints lines with their finger

时光毁灭记忆、已成空白 提交于 2019-12-10 11:23:15
问题 I want to build a tool on Android where the user can paint some simple objects over a picture (eg line, circle or arrow). I started trying the line part first, and indeed I could succeed on painting it. The logic is that the user taps at one point and then drags their finger, painting the line. I use a class like this (it is based on DonGru's answer here): public class DrawView extends View { Paint paint = new Paint(); float Sx, Sy, Lx, Ly; public DrawView(Context context, float x1, float y1,

How do I make my program, written in Java, usable to other people?

邮差的信 提交于 2019-12-10 10:44:33
问题 So I've written a funny little program and I want to show it to some of my friends. My friends, not being programmers, have no idea what to do if I send them the folder containing the necessary classes and files. I want to be able to email them something (or put it on a cd/thumbdrive) that they can then double click and have it run the program. I have absolutely no clue how to make this happen. I'm taking a class and we use linux computers (I use a mac when I'm not in class) and we have to

Draw a tree or organization chart from parent child data

有些话、适合烂在心里 提交于 2019-12-10 08:45:49
问题 I have parent-child information in a table with GroupID (TreeID.) From this table I want to derive something like this: The purpose of drawing a tree is for viewing only. The table has thousands of groupID/tree structures. I am using the .NET platform. How should I proceed? create table parent_child (GroupID varchar(100) null, Level varchar(100) null, Name varchar(100) null, ID varchar(100) null, ParentID varchar(100) null, Top_Parent varchar(100) null) insert into parent_child (GroupID,Level

Drawing Text on monochrome Bitmap in C#

心不动则不痛 提交于 2019-12-10 04:30:02
问题 My problem is that I need to draw text on a monochrome bitmap. The resulting bitmap has to be printed on a thermal POS printer, so the bitmap has to be 1bpp. I'm not good in graphics, so I've tried to find some samples. Here's what I've tried: Bitmap bmp = new Bitmap(300, 300, PixelFormat.Format1bppIndexed); using (Graphics g = Graphics.FromImage(bmp)) { Font font = new Font("Arial", 20, FontStyle.Bold, GraphicsUnit.Point); g.Clear(Color.White); g.DrawString(text, font, Brushes.Black, 0, 0);