There are many pictures of hearts out there. I just wanted to draw a picture of a heart on my own from a math formula I found on the net. Seems there are many formulas to find. This is how it looks: ![Heart.PNG](/attachments/small/1/4c36fe9d031a39f8b3468f1c4f8a8f3d.PNG "align-left") Enjoy!

Member Avatar
+3 forum 0

Hello i have a little problem with moving ball around screen, also i'm confused why i cannot put this variables `double x = 0, y = 16, muvx = 0, muvy = 0;` at the public class MainActivity to be local variables and also i don't know how to set the timer to be on 0.5 sec. `Timer t = new Timer(this, 5);` its shows me error at this line too. Here is the code please explain me what causes the errors and how do i make the ball move, Thank you public class MainActivity extends Activity { static int …

Member Avatar
Member Avatar
+0 forum 3

i am trying to draw an image on to a php page using the imagecreate function but the image is not showing, i cant see the problem with this code, please help me out, the code is as follows: <?php header('content-type: image/jpeg'); $fontSize = 30; $imageHeight = 40; $imageWidth = 200; $image = imagecreate($imageWidth,$imageHeight); imagecolorallocate($image,10,120,0); $textColor = imagecolorallocate($image, 0, 0, 0); imagettftext($image, 20, 0, 15, 30, $textColor, 'font.ttf', 'james'); imagejpeg($image); ?>:

Member Avatar
Member Avatar
+0 forum 1

Hello, I am struggling at trying to get custom fonts working in my application. I have added the font file to the project's resources via the 'Add Existing File...' option, and setup the following code... > FontFamily standard; Font wt; > [DllImport("gdi32.dll", ExactSpelling = true)] private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts); private Font getWetDreamsFont() { byte[] theFont = Properties.Resources.Wet_Dreamz_Medium; int length = Properties.Resources.Wet_Dreamz_Medium.Length; IntPtr ptrData = Marshal.AllocCoTaskMem(length); Marshal.Copy(theFont, 0, ptrData, length); uint cFonts = 0; AddFontMemResourceEx(ptrData, (uint)theFont.Length, IntPtr.Zero, ref cFonts); PrivateFontCollection pfc = new PrivateFontCollection(); pfc.AddMemoryFont(ptrData, length); Marshal.FreeCoTaskMem(ptrData); standard = pfc.Families[0]; wt …

Member Avatar
Member Avatar
+0 forum 1

Hello, This is the first time I've attempted creating controls at runtime, and I'm not sure why the following code isn't working; private void Popup_Load(object sender, EventArgs e) { Panel panel2 = new Panel(); panel2.Size = new Size(1280, 720); panel2.Location = new Point(20, 20); panel2.BackColor = Color.Red; this.Size = new Size(1280, 720); this.Controls.Add(panel2); } I'm also trying to draw a string to the screen, but figured that wasn't working for what's probably the same reason as why the above code isn't working. Any help is appreciated, Thanks.

Member Avatar
Member Avatar
+0 forum 10

Hello everyone, I am attempting to make a custom control similar to a tooltip however I am not sure exactly how to produce the effect I desire. My goal is to have a popup, which is shown when the mouse hovers over a control, that contains some message and is shown at the top center of the hovered control with a triangle "pointer" overlapping onto the control (See illustration). ![e42e24cd2b1615ad81ffe8932e7d2467](/attachments/small/4/e42e24cd2b1615ad81ffe8932e7d2467.png "align-left") I would like the popup to automatically be sized to the text contained within padded by a few pixels; I know this is possible using the `Graphics.MeasureString()` function. I …

Member Avatar
Member Avatar
+0 forum 2

I have a panel where I am drawing images on button click. But on the second button click, the previously drawn image is being replaced by the new Image. void panel_Image_Paint(object sender, PaintEventArgs e) { if (Clipboard.ContainsImage()) { Point p1 = new Point(i, 0); e.Graphics.DrawImage(Clipboard.GetImage(), p1); i += img.Width; } } I want to retain the previously drawn image in the panel, when the new image is being drawn. The clipboard is being refreshed on each button click with the new image. Any help would be highly appreciated!!!! Thanks..

Member Avatar
Member Avatar
+0 forum 3

Saw [this](http://www.daniweb.com/software-development/cpp/code/216430/add-a-little-graphics-to-your-console) and decided to make a little spinoff with some physics of mine. Enjoy!

Member Avatar
Member Avatar
+1 forum 2

Hello, I am making a custom control which will serve as a "timeline". An integrated timer moves a line along the control to display where the time is currently. I am inheriting a Panel control for the timeline. When I draw my line, it constantly appears below the controls in the panel. I would like the line to be visible above all of the controls in the panel. Is this possible? Thanks in advance

Member Avatar
Member Avatar
+0 forum 8

My application requires a dialog box and a parent window, from the window proc of the parent window I'm trying to draw on the dialog box. How might I do this? Thank you for reading :)

Member Avatar
Member Avatar
+0 forum 11

I wanted to draw a 5 pointed star in C# and here is how I finally did it. I leave it as an exercise (some hints are given in the code) to work out how I did this. It was fun to do (but a bit hard, my trig is getting worned out :) ) but if you want to ask questions please do. For the installation of the code please refer to this snippet: [url]http://www.daniweb.com/software-development/csharp/code/359360[/url]

Member Avatar
Member Avatar
+1 forum 13

Lately, I was reading [this snippet](http://www.daniweb.com/software-development/python/code/453788/moon-phase-at-a-given-date-python) by vegaseat. I thought, why not do it in C#? But I would also like to add lattitude and logitude in the celestial calculations and draw a picture of the moon at that moment and location. Now the calculations can get a bit involved but are doable. So first I did a little try out about the drawing of a moon phase picture. Code for the main drawing method is given here. Just call it from a Paint event. A litte project file for a test app is included in a zip file as …

Member Avatar
+1 forum 0

**how to draw a line in c program given the slope and intercept of the line**

Member Avatar
Member Avatar
+0 forum 6

Upon playing with the graphics/random class - I have discovered something odd. Private Sub Me_Load(sender As Object, e As EventArgs) Handles Me.Load For i = 0 To 5000 DrawColor(GimmiRectangle) Next End Sub Private Sub DrawColor(ByVal rNew As Rectangle) Try Dim g As Graphics = Me.CreateGraphics g.DrawRectangle(New Pen(Color.FromArgb(New Random().Next(255), New Random().Next(255), New Random().Next(255))), rNew) Catch ex As Exception MsgBox(ex.ToString) End Try End Sub Private Function GimmiRectangle() As Rectangle Try Dim rect As New Rectangle(New Random().Next(1000), New Random().Next(1000), New Random().Next(1000), New Random().Next(1000)) Return rect Catch ex As Exception MsgBox(ex.ToString) Return New Rectangle(0, 0, 0, 0) End Try End Function This code will …

Member Avatar
Member Avatar
+0 forum 2

Hello :) i'm looking for a proper way of drawing points in MFC. or Drawing those point on a Drawn Eclipse. then i actually have to join them. i had been working on .NET, so i'm less fimiliar to visual C++ 6.0, but i have to use it for this. i can draw eclipse like: [CODE] . . . void CTesttView::OnDraw(CDC* pDC) { CTesttDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDC->Eclipse(100,100,500,500); } . . . [/CODE] but now, how can i draw points on it? since i have to join those points using lines later, how can i keep a track of …

Member Avatar
Member Avatar
+0 forum 4

I would like to create a notebook type application that will accept touch input and allow you to draw on the surface view. I'm unsure what I'm doing wrong since I have not programmed for the Android before. Here is what I have: [CODE]findViewById(R.id.pageSurface).setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { SurfaceHolder holder = ((SurfaceView)findViewById(R.id.pageSurface)).getHolder(); Canvas canvas = holder.lockCanvas(); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setColor(Color.BLACK); paint.setDither(true); paint.setColor(0xFFFFFF00); paint.setStyle(Paint.Style.STROKE); paint.setStrokeJoin(Paint.Join.ROUND); paint.setStrokeCap(Paint.Cap.ROUND); paint.setStrokeWidth(3); canvas.drawPoint(event.getX(), event.getY(), paint); holder.unlockCanvasAndPost(canvas); return true; } }); }[/CODE]

Member Avatar
Member Avatar
+0 forum 2

Hello guys, So my task is the following: Draw a pine tree based on user inputted height. How tall should the tree be?: 6 /\ / \ / \ / \ / \ / \ ------------ || || || I had problems moving the cursor from the left to right in order to draw the backlash characters, however, I managed to do some of it, but they do not align in the way they should. I would appreciate any help, here is my code: [CODE] #include <iostream> #include <stdlib.h> using namespace std; int main () { int height; cout << …

Member Avatar
Member Avatar
+0 forum 2

Hi, I wrote a drawing tool program by using vb6. I scans a big house plan (A3 size) and load many little pictures as the element of the house. The user can manipulate the house plan and saved it back. I used normal vb6 method to load and save the picture, by using loadpicture and savepicture method. My problem is the saved picture is as large as 5 mb and the load picture requires very big amount of graphic memory and it will cause "out of memory" error whenever the computer doesn't have enough memory to start it. It takes …

Member Avatar
Member Avatar
+0 forum 1

When you want to draw something on a form you need a Graphics object. But a Graphics constructor isn’t public and if that is not enough the Graphics class is also sealed! This means you can’t create a Graphics object via the new keyword nor can you derive from the Graphics class. One way to get a Graphics object is through a Paint event handler of a Form via the PaintEventArgs class. OK now you can use an array of Points, pass it with a Pen object to DrawLines and it draws your function! This is not what I want …

Member Avatar
Member Avatar
+0 forum 15

[B]I was trying to create an application implementing the Douglas Peucker algorithm in VB.NET. I already finished coding the program and tried to compile it but when I try to draw on the form, it is not working. My source code is below, I just want to ask if there are some missing code or are there any code I have to include, or there are "WRONG" codes I've included. Thank you for your help![/B] If you need the other class, kindly inform me, I will just attach it. Thanks [CODE]Imports System.Collections.Generic Imports System.ComponentModel Imports System.Data Imports System.Drawing Imports System.Text …

Member Avatar
Member Avatar
+0 forum 4

Hi I want to khow about drawing methode in C# that has no dependence in pixel, do anyone can help me? I want to draw patterns and then print them, I can Draw them but when I want to print, I have Problems with measurments because I draw them pixel by pixel and now I want to print them in CM

Member Avatar
Member Avatar
+0 forum 9

So, I need to make a program that draws a [URL="http://en.wikipedia.org/wiki/Automata_theory"]finite automata[/URL] from the input data. I had some experience with the [I]graphics.h[/I] header but as far as I know it's a Borland only header and VC++ doesn't support it. So I was wondering, is there a way to draw some simple shapes and lines on VC++, besides using OpenGL?

Member Avatar
Member Avatar
+0 forum 7

This is not about a DataGridView or something else, it is just about drawing a simple grid in a form window. Googled a bit but found not much of my liking. A Grid as a BitMap in a PictureBox? Come on! Must have been some of those GUI guys I guess. I find it easier to draw in a Form or a Panel in a Form, so I have total control over where to draw a chess piece or a Sudoku number or whatever. Or I could draw a graph with a grid; think it’s harder to do that with …

Member Avatar
Member Avatar
+0 forum 6

I want to draw a editable TextBox on top of picture box and the user is allowed to enter text into this box.After entering text the text box should disappear and the text entered should be painted to the picture in the picture box.Please help me on this,I'am doing this in c#.

Member Avatar
Member Avatar
+0 forum 6

:( Sorry the topic spelled incorrectly.. I can't edit it noe.. sorry for that Friends again need you so badly.. I'm developing my simple GIS application, actually here's what I developed so far.. [CODE] import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; class GUItest01 { public void go(){ JFrame frame = new JFrame("app"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ImageIcon image = new ImageIcon("C:/icon.jpg"); JLabel label = new JLabel(image); label.setPreferredSize(new Dimension(1200, 1000)); JScrollPane jScrollPane = new JScrollPane(label); JPanel panel = new JPanel(); frame.add(jScrollPane, BorderLayout.CENTER); //frame.setResizable(false); panel.setBackground(Color.cyan); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); JButton button = new …

Member Avatar
Member Avatar
+0 forum 6

What polar coordinates are is explained [url=http://en.wikipedia.org/wiki/Polar_coordinate_system]here[/url]. I wanted to draw some polar functions myself, so I changed my [url=http://www.daniweb.com/software-development/csharp/code/217204]plotting class [/url] a bit and added a polar struct to a new project.. Just posted code for the Plot class and the polar point structure here. You can find an example of output as well, and the complete project in a zip file. This is just a basic thingy, so error correction is also basic. Enjoy! :)

Member Avatar
+2 forum 0

I m developing a java app that will have a GUI to draw the graph and implements the graph coloring algorithm to colour the nodes. I started with JFrame and Canvas and could draw lines and circles with paint() and repaint methods.. The problem is repaint method erases the previous info in the window.. i want to retain the nodes and edges drawn so far and continue drawing new edges.. I tried the overloaded version of repaint that repaints a portion but it is not efective.. i need to draw on the existing lines and nodesby overlapping them.. how can …

Member Avatar
Member Avatar
+0 forum 5

The script is used in my newest chrome app [url]https://chrome.google.com/webstore/developer/detail/bomkcodcgmbjjhogdjophonfhgpegoni/[/url] Site: [url]http://codestrix.co.cc/pixels/[/url] The above script is a good to get stated with HTML5 canvas. Much of it is named so as to be self explanatory but any doubts you are more than welcome to post it here.

Member Avatar
Member Avatar
+1 forum 2

Hello I currently have a program that collects data from a txt file and then works out the averages of each column. What I am now trying to do is use this data to draw a line Graph for each individual column contained within the txt file. This is the code I currently have that reads the data and works out the averages. [CODE]private void GetDataFromFile() { Dictionary<int, List<int>> dic = new Dictionary<int, List<int>>(); string tag = "[HRData]"; string path = "test.txt"; //string path = (Chosen_File); using (StreamReader sr = new StreamReader(path)) { string line; int counter = 1; while …

Member Avatar
Member Avatar
+0 forum 2

Ever wanted to know how to implement running lights? well here is your chance to find out. Open a new Forms application enlarge the Form a bit and drop a Panel and a Timer on it. Add the class ChasingLights to the solution, see code. Implement a form Load, panel Paint and Timer Tick event. See code. I have included the result you should get(without the "lights" running;) ) Also added a few fancy tricks you can do with strings. Have fun!

Member Avatar
Member Avatar
+5 forum 1

The End.