drawing

Win32 Text Drawing Puzzle

Hello :) I've got a little text drawing puzzle under Win32. I'm trying to draw some instructions for users of my application at the top of the window. Please refer to the following window (I've changed the background color on the text so you can see the boundaries) I'm currently using DrawTextEx to draw the text to my window, but th...

Saving Panel as an Image ...

Hi Im doing this paint application its kind simple it consist of a panel where i will draw on and then finally I will save as jpg or bmp or png file. My aplication work perfectly but the problem Im facing is that when Im saving the output is not what drawn on the panel its black Image nothing just black. all my work is been saved as ...

Drawing programmatically using C# in Silverlight

I am trying to create an Aitoff-Hammer grid in Silverlight using C#. It should look like this minus the dots and numbers. I am not a programmer but have been able to piece together this using an ActionScript file to do the same thing that was written by my predecessor. As you can see, I get the grid plus unwanted diagonal lines. I am no...

Javascript based drawing library for free hand drawing?

hello, I've seen there's a lot of libraries that will allow me to output shapes and lines but do these libraries allow for freehand drawing using the mouse? I want to allow users to draw and then to save their work to database. Is this possible? Thanks in advance! ...

Haskell pixel drawing library linux

I wish to draw individual pixels on a screen in a window or something for real-time display in haskell. I'm just getting started with haskell (but not functional programming, and not graphics), so I'm trying to create some rudimentary graphics things with it. I have tried to use SDL, but the following code gives me a blank screen: imp...

Drawing on multi screen with WPF

Hi all, I've created an application that display a topmost window on each monitor, to cover all available place. Then, I would like to allow to draw a rectangle on the windows. So, I create a rectangle that I add to the window when mouse move and mouse click ... This is working except when I'm drawing a rectangle that starts on a windo...

C# image drawing colours are incorrect

I have a source bitmap that is 1x1 and I am trying to take that image and draw it to a new bitmap. The source bitmap is all red, but for some reason the new bitmap ends up with a gradient (see image). Using the code below, shouldn't the new bitmap be completely red? Where is it getting the white/alpha from? private void DrawImage() { ...

Creating a Squircle

Hello there. I'm a first year programmer. I'm trying to create a squircle. (square with round corners). So far i have managed to get. I have been given the constants of a,b and r. If anyone could help i would be really thankful. I'm a total noob to this. So be nice :) package squircle; import java.awt.*; import javax.swing.*; import ...

How to load a specific patch/rectangle from an image?

We have an application that show a large image file (satellite image) from local network resource. To speed up the image rendering, we divide the image to smaller patches (e.g. 6x6 cm) and the app tiles them appropriately. But each time the satellite image updated, the dividing pre-process should be done, which is a time consuming work. ...

Shorten a line by a number of pixels

I'm drawing a custom diagram of business objects using .NET GDI+. Among other things, the diagram consists of several lines that are connecting the objects. In a particular scenario, I need to shorten a line by a specific number of pixels, let's say 10 pixels, i.e. find the point on the line that lies 10 pixels before the end point of t...

Help with Open GL iPhone

I am trying to put an OpenGL View into my application but I want to make sure that before I do this that the view is transparent because I want to see and interact with the view behind it as well as the OpenGL View. Meaning I want to have something on an OpenGL View as well as the Image View behind it ...

Java OpenGL draw a star

Hi, I'm working on an OpenGL project in which I want to draw a star. It doesn't necessarily have to be a 3d looking star (2d looking is fine). I have the xyz coordinates for the center of the star and I know the size I'd like it to be. I don't do much OpenGL/3d math programming, so any help here would be much appreciated. EDIT: More det...

How to debug GDI+ in c#?

i have a user control, and it's not drawn correctly, how to debug the drawing? If i set break point, the control will get blocked, i can't see the drawing result instantly? any idea? ...

Drawing lines between elements in WPF

What is a good approach for drawing lines between elements in WPF? I have a view in my application with several buttons that make up a diagram. They scale and move depending on the view's size and shape. I would like to indicate a relationship between some of the buttons using a line. I am not using a Canvas to lay everything out becau...

Draw a new Curved Shape inherited from LineShape

Hello, I use Microsoft.VisualBasic.PowerPacks. LineShape component. This component is good, but I want to draw a curve instead of a right line. I stardet to modify the OnPaint: protected override void OnPaint(PaintEventArgs pevent) { //base.OnPaint(pevent); pevent.Graphics.DrawLines(Pens.Green, new ...

How to fill a square with smaller squares/rectangles?

This is not a homework or interview question. In my office at work, we are not allowed to paint the walls, so I have decided to frame out squares and rectangles, attach some nice fabric to them, and arrange them on the wall. I am trying to write a method which will take my input dimensions (9' x 8' 8") and min/max size (1' x 3', 2', 4',...

Filling a Partially Rounded Rectangle with GDI

I have a rounded rectangle that I make like so dc.RoundRect(textBorder, CPoint(20, 20)); Later on I draw a line through it about 1/3 of the way down. dc.LineTo(textBorder.right, textBorder.top + 15); Now I would like to fill just the part above the line with a solid color. In other words I need to fill a partially rounded rectan...

drawTextInRect on UITextField not called

I'm trying to implement the answer to this SO question. The problem is: -[drawTextInRect] is apparently not called, and setting the shadow in -[drawRect] doesn't make the UITextField's text shadowed. Another weird thing is that even if my subclass implementations of -[drawTextInRect] and -[drawRect] are completely empty (not even a call...

Changing the fill to a already drawn NSBezierPath

I'd like to change the fill of a button that I've drawn (I subclassed NSButton) Here's the code I've got already: - (void)drawRect:(NSRect)dirtyRect { // Drawing code here. // Create the Gradient NSGradient *fillGradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor darkGrayColor]]; // Creat...

PictureBox.Refresh() is slow when drawing in a PictureBox

I have a Windows Form Application in Visual Studio 2008 - PictureBox.Refesh() method causes a delay when drawing on a PictureBox. Is there any method that gives the same result without delay? ...