drawing

which one would you use to draw stuff on a winform? Format32bppRgb or Format24bppRgb or something else?

in any .net version Format24bppRgb Specifies that the format is 24 bits per pixel; 8 bits each are used for the red, green, and blue components. Format32bppRgb Specifies that the format is 32 bits per pixel; 8 bits each are used for the red, green, and blue components. The remaining 8 bits are not used. ...

How to correctly draw a listbox and image in .net?

protected override void OnPaint(PaintEventArgs e) { e.Graphics.DrawImage(render, 400, 400); } This is the OnPaint of the Form1 class. The form has a listbox. The problem is with the render only showing partially when doing a resize on the form. Is the listbox somehow clipping it out? The listbox and the bitmap don't overlap. I've ...

Python - Best library for drawing

So I'm looking for a pretty basic library in python where i can create a window, and then draw lines and basic shapes too it. Nothing too complex, just nice and simple. I figure theres lots of libraries out there that can do this, but I don't know any of them. Can anyone give me some recommendations? Thanks EDIT: Note that there are se...

setNeedsDisplay not working?

Hi all! I have a problem redrawing a custom view in simple cocoa application. Drawing is based on one parameter that is being changed by a simple NSSlider. However, although i implement -setParameter: and -parameter methods and bind slider's value to that parameter in interface builder i cannot seem to make a custom view to redraw itsel...

how to draw lines on a picture background in pygame

I would like to draw lines (of arbitrary position and length) onto a surface in pygame, which itself is an image loaded from a file on disk. Can anyone point me to some example code that does this? ...

How to create ContextMenuStrip in C# which items are images?

I want to create context menu in C# which items are images of different heights and widths. Main problem I don't know how to solve is how to set width and height for menu items and context menu. If autosize for menu items is enabled, then heights of all menu items are the same. If I disable autosize for menu items, then I cannot proper...

What is the algorithm for storing the pixels in an oval in Javascript?

How would one draw an oval in JS? ...

What is the algorithm for storing the pixels in a spiral in JS?

What is the algorithm for storing the pixels in a spiral in JS? ...

Drawing in javascript with divs

In my quest to learn javascript (which seems to be my latest source of questions for SO these days) i've found this API for drawing http://www.c-point.com/javascript_vector_draw.htm Meanwhile I've been making some experiments with graphics, which tend to be heavy on the amount of stuff to draw. This guy is drawing with divs, every squar...

Create a colored bubble/circle programmatically in ObjectiveC and Cocoa

Can anyone guide me in the correct way to build a colored bubble/circle programmatically? I can't use images as I need it to be able to be any color depending on user interaction. My thought was maybe to make a white circle image and then overlay a color on top of it. However I am not sure if this would work, or how to really go about ...

Python Canvas

I'm looking for a Python library for creating canvases for manipulating gemetric shapes. Specifically I need the ability to create arbitrary polygons and place them on the canvas, the polygons need to have the ability to be transparent/have an alpha channel, I need to be able to edit polygons that are currently on the canvas, and I need...

Lets draw a spider...

Hello, I am new to c# and VS, but I am getting it. The application is this: A program in which the end result will draw a spider from options in which the user will define. Lets say there are 100s of options: size and number of body parts, color, connections points to the body, etc. First question: Should I try to use the library includ...

Where should I start drawing? (Java,GUI)

I have the points by the end of the GenerateButton class but now that I got my public double[][] matrix with all the points in, where do I begin drawing them??? my Main.java: import java.awt.*; import javax.swing.*; public class Main { public static Display display = new Display(); public static void main(String[] args) { ...

Convert bitmaps to one multipage TIFF image in .NET 2.0

How can i convert an array of bitmaps into a brand new image of TIFF format, adding all the bitmaps as frames in this new tiff image? using .NET 2.0. ...

opengl slow on texture blit

I called this function once per frame and it took my FPS from >400 to 33. Why? sw blt(const PtRect *dstRect, Texture *src, const PtRect *srcRect, RenderDevice::bltFlags flags=RenderDevice::bltDefault) { assert(src); GL_Texture *glsrc = dynamic_cast<GL_Texture*>(src); if (glsrc == 0) return -1; PtRect srcRect2(0, 0, src->width, sr...

Drawing a line in Visual Studio .net at design time

The owner of my company wants to be able to draw lines in Visual Studio.net as he did Visual Basic 6.0. So far the only method I have found is a runtime method using system.drawing which of course only work during runtime, and not quite practical for what he wants to do. Is there any third party control (free or otherwise) that will gi...

.NET C# drawing slowly

Hi all, I have a problem drawing something quickly in .NET. I don't think that any thing in particular should take much time, but on every machine I've tried it on, I get serious issues. This is implemented in vs2008 .NET, using C# (with some stuff in C++, but nothing relevant to the drawing). I have three screens, and the user shou...

Looping buffered paint animations for custom default buttons in Vista

We custom draw our push buttons in Vista, which allows us to use the fading / BufferedPaintAnimation features. However one thing that has eluded me is how to handle the default button. This is the one that continues fading (pulsing) that is not in response to user action. I have considered setting a timer for the animation duration, but ...

Graphics.DrawRectangle(Pen, RectangleF)

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawrectangle.aspx FillRectangle, DrawRectangle, FillElipse and DrawEllipse all can take 4 Float (or "Single") parameters: x, y, width, height. DrawRectangle is the only one that will not take a RectangleF, though. I was wondering if anyone knew why this is. It sure seems ...

Image representation suitable for both WPF and Windows Forms

When working with Windows forms and images, I deal with System.Drawing.Image descendats. When I work with WPF I deal with System.Windows.Media.Imaging.BitmapSource class. Is there a UI framework independent way of referencing a memory image? Maybe it would be a Intptr or byte array? Thank you. ...