graphics

Merge an image, a background and Text into a single image

与世无争的帅哥 提交于 2020-01-06 15:08:06
问题 I found this code here: Private _BackgroundColours As New List(Of String)() From { _ "339966", _ "3366CC", _ "CC33FF", _ "FF5050" _ } Public Function GenerateRactangle(firstName As String, lastName As String) As MemoryStream Dim imgSize() As Integer = {800, 800} Dim avatarString As String = String.Format("{0}{1}", firstName(0), lastName(0)).ToUpper() Dim bgColour = _BackgroundColours(New Random().[Next](0, _BackgroundColours.Count - 1)) Dim bmp As Bitmap = New Bitmap(imgSize(0), imgSize(1))

Coreplot in swift: change starting value of axis to 1

流过昼夜 提交于 2020-01-06 14:53:16
问题 I have a graph and I wan't that the x and the 2 y to start at 1 not 0. ![enter image description here][1] This is how i setup the plotspaces: //plotspace 1 var plotSpace: CPTXYPlotSpace = graph.defaultPlotSpace as CPTXYPlotSpace var xRange = plotSpace.xRange.mutableCopy() as CPTMutablePlotRange var yRange = plotSpace.yRange.mutableCopy() as CPTMutablePlotRange xRange.length = self.maxX yRange.length = maxPoids plotSpace.xRange = xRange plotSpace.yRange = yRange //plotspace2 (second y) var

Java: Why doesn't this JPanel paint properly?

十年热恋 提交于 2020-01-06 14:51:28
问题 I have a 2D array. I want each pixel to be represented by a total of four in the actual image. I've tried various piece of code but none seem to work and I don't really understand how it works either. So far I have: panel = new JPanel() { @Override public void paint(Graphics g) { Rectangle rect = g.getClipBounds(); g.setColor(Color.white); g.fillRect(rect.x, rect.y, rect.width, rect.height); for (int i = 0; i < m.width(); i++) { for (int j=0; j < m.height(); j++) { g.setColor(Color.red); g

Java: Why doesn't this JPanel paint properly?

99封情书 提交于 2020-01-06 14:50:07
问题 I have a 2D array. I want each pixel to be represented by a total of four in the actual image. I've tried various piece of code but none seem to work and I don't really understand how it works either. So far I have: panel = new JPanel() { @Override public void paint(Graphics g) { Rectangle rect = g.getClipBounds(); g.setColor(Color.white); g.fillRect(rect.x, rect.y, rect.width, rect.height); for (int i = 0; i < m.width(); i++) { for (int j=0; j < m.height(); j++) { g.setColor(Color.red); g

Multithreading RayTracer generating artifacts with two different algorithms

穿精又带淫゛_ 提交于 2020-01-06 14:26:07
问题 I have been trying to implement multithreading with my RayTracer, but I am experimenting strange artifacts related to MT. Now I am sure that is not algorithm related, because its happening with two different approaches. Bellow is what happening with a MT algorithm where the first thread takes care of the lower half of the image and the other the top half. In first case I send the thread0 to return before doing anything, in the second case, the thread1 returns. Working as expected. Now with

Drawing basic shapes in python 2 [closed]

孤者浪人 提交于 2020-01-06 13:55:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . How would I draw a simple partially transparent rectangle in python. I would like to not download anything from the internet and purely use python 2.7.3. I would like to also control where the rectangle starts and ends and control its width and height. The end goal of this is to

ending the ball's path

故事扮演 提交于 2020-01-06 10:20:21
问题 I have a small panel where i am making a ball to move by just varying it's x co-ordinate . I want the ball move back when it encounters the end of frame.The width of my frame is 300 (by fr.setSize(300,300)) . Now I programmed the animation like : // when x == 300 // stop the timer But x=300 seems to be greater than it's width which is 300 ! How is this possible. **The ball moves out of the 300 x 300 frame and becomes invisible. Why is this happening ? These are the screen shots of what

What image types does VB6 support?

亡梦爱人 提交于 2020-01-06 07:57:16
问题 What specific picture or image types & formats does VB6 support? I can find specific examples here on SO but I haven't seen any comprehensive information. I am mainly interested in what can be used "natively" by VB6, though I am sure there are third-party libraries and/or other methods of loading additional image types. 回答1: The function LoadPicture (loosely) defines what graphics formats are "supported by VB6" in a native sense. Here are the relevant details: Loads a graphic into a forms

Cannot find sdl2main

人走茶凉 提交于 2020-01-06 07:05:06
问题 I'm trying to compile code using SDL, I can't really post much of the code here but I can do my best to answer questions about it. The problem occurs when compiling the view code and trying to link the SDL libraries. g++ -o test test.c -lSDL2main -lSDL2 gives me an error /usr/bin/ld: cannot find -lSDL2main I know my SDL install is okay because if I leave out the link to SDL2main it compiles fine and runs fine. The problem is there is other code that needs SDL2main. I've poured through my file

Smooth movement of icon displayed on a Panel

↘锁芯ラ 提交于 2020-01-06 05:38:29
问题 I'm coding an app where I display a System.Drawing.Icon object on a System.Windows.Forms.Panel using a code that goes something like so: Graphics g = _panel.CreateGraphics(); g.DrawIcon(this.NodeIcon, _rectangle); I have code to move the icon around using drag-n-drop. My problem is that when the user move the icon around, it is anything but smooth. The icon looks distorted until the user stops moving the icon. I have tried to find information on this around the net but I can't get it to be