Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!


Archived Months
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
December 2007
January 2008
February 2008
March 2008
April 2008
May 2008
June 2008
all groups > dotnet drawing api > october 2006

Filter by week: 1 2 3 4 5

GraphicsPath to Points list
Posted by googler at 10/31/2006 11:47:25 PM
I am using GraphicsPath for drawing objects such as line, ellipse... But I have to retrieve a list of points that this path contains. How could I do this? Thanks. ...more >>


Question on Animation
Posted by pamela fluente at 10/31/2006 6:18:01 AM
In a fast animation done by repeatedly displaying a bitmap on a picture box ... what is better: 1. to recreate, each time, the bitmap and graphics object (disposing the previous ones) or 2. to "clean up" the existing bitmap and redraw on it ? And, in case what is the ...more >>

Identify shape in image
Posted by John at 10/31/2006 12:00:00 AM
Hi there, Can anyone tell me how to go about identifying the location of a shape in an image? I have a series of images that all have a blue circle somewhere in the image. I would like to be able to identify the location of the circle in some kind of x y position relative to the image its...more >>

Getting raw bitmap byte data from bitmap image
Posted by mpalacio NO[at]SPAM gmail.com at 10/30/2006 3:03:41 AM
Hi guys, Does anybody know how to retrieve/parse the raw bitmap bytes from a bitmap image? In other words, excluding the header data. Thanks so much! Am using c# btw. ...more >>

Outlining Pixels with transparent background
Posted by Jude Martin at 10/29/2006 9:47:35 PM
Hello, I have been searching for a solution for many days now and would like to throw this question out to anyone who may be able to assist. I am trying to find a way to add an outline to non transparent pixels in a Bitmap object. The background is painted Color.Transparent and any...more >>

Drawing to a Metafile twice.
Posted by mccoyn at 10/28/2006 12:06:02 PM
I'm trying to write a program like Paint that draws to a Metafile instead of a bitmap. I can create the Metafile, but the second time I try to draw to it I get an OutOfMemoryException. I've written a simplified program with two buttons. The Click handlers are below. When I click button1 ...more >>

Getting a path from the intersection of two regions
Posted by Valerie Hough at 10/27/2006 1:48:32 PM
Hi, I would like to be able to determine the outline of the intersection of two polygons, even in the case where more than one polygon might result. My strategy was to create a graphicsPath object for each polygon, create a region from each of those, then apply Region.Intersect(). Once I ...more >>

Set PixelData of Bitmap by Pointer
Posted by msedi at 10/27/2006 8:26:43 AM
Hello, I have a short array short[] RawData; filled with medical image data. Each pixel is represented by a short value, which must be windowed by special settings. As I cannot use PixelFormat.Format16bppGrayScale in GDI+, I tried to use the PixelFormat.Format16bppRgb555, because I real...more >>



Get mouse click nearest object
Posted by SP at 10/27/2006 4:15:51 AM
Hi, I've a Object model with line rectangle text and circle. I need to get the nearest objcet to mouse click point to select and move the object. I've used GraphicsPath.isVisible, but if I have a rectangle and a line in it I can't get the line. I need a function or algorithm to get the nearest ...more >>

GDI+ or DirectX on Windows Vista for 2D graphics
Posted by Tomaz Koritnik at 10/26/2006 10:35:28 PM
I'm making plans to develop an 2D interactive vector graphics library. It will be used to render basic graphics primitives (lines, polygons,...). It has to be fast and my questione is, which one to use on Windows Vista, GDI+ or DirectX? Has anyone tested the performance of both on Vista? I ...more >>

Lockbits question
Posted by keperry at 10/26/2006 2:43:25 PM
Ok..so I was trying to follow the example on Bob's site: (http://www.bobpowell.net/lockingbits.htm) BitmapData bmd=bm.LockBits(new Rectangle(0, 0, 10, 10), System.Drawing.Imaging.ImageLockMode.ReadOnly, bm.PixelFormat); int PixelSize=4; for(int y=0; y<bmd.Height; y++) ...more >>

Question on graphic objects disposing
Posted by pamela fluente at 10/26/2006 4:08:12 AM
I have a question on object disposing. On a form I have several controls that represent document pages. Each of these page has a Bitmap and a Graphics object associated. When scrolling the document, pages are continuosly disposed of and recreated on the fly. This is done dozen ...more >>

A question about TextureBrush
Posted by kurt at 10/25/2006 6:02:31 PM
hello all i am getting a strange effect when i use TextureBrush to fill a areal on a graphic surface. It seems that when the areal is not very large the filling effect is normal but when the length or width of the areal is very large for example more than 60000(inot exactly,i mean the numbe...more >>

How to draw to the screen not the form?
Posted by cheapguy at 10/25/2006 2:27:16 PM
I need some code (VB or C#) that will draw a series of rectangles (unfilled) to the screen's area, not a form or window area. I am trying to simulate a technique I have seen when a new window opens, a series of ever-larger rectangles are drawn to give a dynamic confirmation that the form is open...more >>

Tiff or Tif with Jpeg Compression problem
Posted by aggc at 10/25/2006 3:13:02 AM
Hi everyone, I'm using .net framework 1.1 and i'm doing an application that manipulate tiff images. Almost everything works fine.. But when Tiff images with jpeg or ojpeg compression appears, System.Drawing.Image raises an exception. I've tried many ways to work around the problem.. but i...more >>

Is there a good way to extract an object from a background?
Posted by keperry at 10/24/2006 7:28:03 PM
Hi all, Ok..., I can honestly say that I didn't think this entirely through. Is there a clever way through a "green screen" or some other method to extract an object from its background. Most likely the objects would be pretty simple, but I need a robust way of doing this via programming. ...more >>

Drawing line over image
Posted by Peter at 10/24/2006 10:17:36 AM
Hi! I have already a method in c# to open an image and load it in a picture box that I've created. It uses Bitmap class(LockBits and UnlockBits). Can someone tell me how do I draw a line over the image using the mouse? The idea is to measure the distance between the initial and endpoint of the line....more >>

Read in JPEG file and then access each pixels value
Posted by keith.b.perry NO[at]SPAM gmail.com at 10/24/2006 9:22:53 AM
Basically, I want to end up comparing pixels of two different JPEG files. So I would like to read in the JPEF file and then access each pixel's RGBA values. Is there a simple way to do this? ...more >>

Bold, Underline Markup for DrawString
Posted by Phil Jones at 10/24/2006 12:00:00 AM
When using the g.DrawString() method to draw to a [Graphics] surface... Is it possible to specify some kind of markup within the source text to tell it to render some items bold, and some items underline, italic etc. For instance, achieve the same result as this HTML would when rendered wi...more >>

A AccessViolationException problem
Posted by ycat at 10/22/2006 6:38:09 PM
I sometimes got some AccessViolationException from System.Drawing.dll. Is it a known issue in .NET 2.0? I've never got this kind of exception in .NET 1.1. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. ...more >>

Scaling a collection of points (lines)?
Posted by Craig Lucas at 10/20/2006 9:49:25 PM
Im kind of new to vb.net drawing routines. Im reading a collection of 2d points from a proprietary file. These points are simply for drawing lines, I can draw the lines fine using Graphics.DrawLine, but I need to scale all the lines to fit a rectangle of a given width and height. What is t...more >>

Vertical Text
Posted by Bill Burris at 10/20/2006 11:34:25 AM
Hi, When drawing vertical text the result is facing the wrong way. How do I rotate the result by 180 degrees? The code: public void CenterVertText(Color color, Rectangle r, string str) { int y2 = p.Height - (r.Y + r.Height); // y = 0 at bottom ...more >>

GDI or GDI+
Posted by dave at 10/20/2006 9:27:01 AM
Hello: I have C# appl that uses GCI+ to draws/updates complex graphs every sec. There is seldom small flickering. Does somebody know if switching to GCI will eliminate/reduce flickering ? thnak you....more >>

Text color using WriteLine
Posted by John Harcourt at 10/19/2006 1:02:02 PM
In a console application, how can I specify the color of the text when I do a System.WriteLine() method? This is assuming of course that the output is the console. Thanks for any help. ...more >>

Text color using WriteLine
Posted by John Harcourt at 10/19/2006 1:02:02 PM
In a console application, how can I specify the color of the text when I do a System.WriteLine() method? This is assuming of course that the output is the console. Thanks for any help. ...more >>

Check if area is empty
Posted by Teemu at 10/18/2006 5:07:05 PM
Hello! Let's assume that I have a graphics object which contains lines and text in arbitrary places. Then I take a small region from that graphics object. How can I check if that region is empty? I mean the area contains only a solid background color and there are no parts from lines or te...more >>

Drawing a windows form partially
Posted by Stig at 10/18/2006 3:43:57 PM
Hi When I paint a form I would like to specify that a part of the form should not be painted, to achive a transparent area of the form. I have tried overriding the OnPaint and OnPaintBackground methods and then tried to manipulate the graphics object's clip region to get an area of 50x50 pi...more >>

Saving a Bitmap or Image type to a Byte() in a database - SQL Server 2005
Posted by jason.smart NO[at]SPAM email.cs.nsw.gov.au at 10/18/2006 12:00:00 AM
Thanks Bob for previous link. The problem now is that the images are stored in the database as a Byte( ) , ie a Byte array. So I am having trouble converting the System.Drawing.Bitmap type into a Byte( ). CType won't do this. Can anyone help me do this with Visual Basic 2005. Thanks Jason ...more >>

Split a multipage TIFF file into single pages with VB 2005
Posted by jason.smart NO[at]SPAM email.cs.nsw.gov.au at 10/17/2006 12:00:00 AM
I need to save and retrieve multipage TIFF images to and from a database. I would like to save them as seperate images in the database. I am using VB 2005 and I can currently save and retrieve a multipage TIFF but only as one image so I can only see the first page. Can anyone steer me in the rig...more >>

The best technology for this job
Posted by khlaw NO[at]SPAM time.net.my at 10/16/2006 9:52:53 AM
May I know, what is the best technology to draw a few rectangle 3d box and later send the screen display to printer. ...more >>

Blue border on images TreeView
Posted by ms NO[at]SPAM ecsit.nl at 10/16/2006 2:14:32 AM
Hello, I created a TreeView in C#.NET. The treeview has an imagelist with some images for the Nodes. The ColorDepth of the ImageList is: Depth32Bit. But sometimes when I click a node, the images got an blue background and/or border color. How can I prevent this? And what is the problem tha...more >>

Get the COLOR under the mouse anywhere
Posted by pamela fluente at 10/15/2006 12:07:07 PM
Hi guys. A hard problem ;) I have a form. The form has: 1 Label, 1 Panel. I wish that 1. while the mouse move anywhere on the screen, that the label continuosly shows the RGB values of the color pointed by the mouse 2. when one clicks, the panel background color is set to the current c...more >>

How to deal with fully transparent ARGB pixels?
Posted by Carles at 10/13/2006 1:56:04 PM
Hello, Supposed a 3x3 ARGB (not-premultiplied RGB) bitmap where: - Center pixel is defined as hFFFFFFFF (pure white and full opaque) - Eight surrounding pixels are defined as h00FF0000 (pure red and full transparent) Now supposed we resize image to a 5x5 bitmap. A simple interpolation me...more >>

How do I draw non-antialiased, pixel-perfect rounded rectangles?
Posted by Joergen Bech NO[at]SPAM at 10/13/2006 12:00:00 AM
I need to draw rounded rectangles on the screen as well as on a printer device. Ideally both filled and unfilled. I have seen multiple examples on the Internet using paths/arcs, but they all seem to produce asymmetric for some - if not all - corner diameters. Some examples gloss over this pr...more >>

2d Tile Maps and Sprites
Posted by AMDIRT at 10/12/2006 11:39:01 AM
Hello Everyone, I am hoping that you can point me into the correct direction. I am playing around with a 2d tile map and am wondering how to display and be aware of items. Example 1: my tiles are 32X32 while I have a tree that is 128X96. When I place the tree at coords 4,3 or 4 tiles ...more >>

C#/.NET code for graphics similar to Paintbrush?
Posted by Loren Rogers at 10/12/2006 9:56:25 AM
Hello, I'm sure something like this may have already been asked, and I'm going to do a search. But I'm looking for some code snippets or code base of how to paint different objects like scribbles, or text or a picture on a window and then be able to select that individual object to move it ...more >>

Scrolls and Painting Refresh
Posted by KillerCode at 10/12/2006 3:51:40 AM
Greetings to you all I've been desperated because I can solve this... Please someone give a hint Here is the problem... I have a form with a datagrid and above the datagrid I'm doing some painting on the OnPaint event of the Form. When I scroll the grid left or right they should both...more >>

Fading at bottom of images on resize?
Posted by Chris Ashley at 10/12/2006 1:45:17 AM
I am splitting up a large image into strips and then resizing the individual pieces using the following code: Bitmap bmOutput = new Bitmap(intDestWidth, intDestHeight); bmOutput.SetResolution(bmpToSize.HorizontalResolution, bmpToSize.VerticalResolution); Gra...more >>

GDI or GCI+
Posted by dave at 10/11/2006 4:30:01 PM
Hello: I have UI that have two panels on which complex images being redrawn every sec. It works OK but sometime there is slight, vey small flickering I wrote it using GDI+. I've heard that most card don't support GCI+. Bob Powell mention that "Matrox" and "AFAIK" the only one to s...more >>

AutoScrollPosition not updating scroll position
Posted by illegal.prime NO[at]SPAM gmail.com at 10/11/2006 3:07:22 PM
So I have a working application that has two panels - Panel A and B. Panel A sends scroll updates to B. Then I added a third Panel to my application that sits atop these two panels (call it Panel C). If I make Panel C visible by increasing its height - then my AutoScrollPosition updates to Pan...more >>

how to get coordinates of image in picutre control
Posted by Pannu at 10/11/2006 10:14:43 AM
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and display (in the status bar) the image coordinates of the mouse location. However, if I use the p...more >>

MemoryStream and ImageFormat.Png problem?
Posted by OPL at 10/11/2006 12:00:00 AM
I'm having a problem trying to read a bitmapped file into a memory stream and then into a byte array. Here's an example as to what I'm doing: Bitmap bmp = new Bitmap(@"c:\windows\Soap Bubbles.bmp"); MemoryStream mem = new MemoryStream(); bmp.Save(mem, ImageFormat.Png); byte[] imageArray =...more >>

Drawing Charts with GDI+
Posted by ThunderMusic at 10/10/2006 11:01:30 AM
Hi, I have a question... I'm trying to learn how to draw charts using GDI+, especially pie charts, but would do bar charts afterward... I know there are a lot of third party libraries out there, but I want to learn how it's done. For 2D, there's no problem about it... my problem comes with...more >>

Automatic Drawing
Posted by joelcochran NO[at]SPAM gmail.com at 10/6/2006 11:06:01 AM
I have a CF2.0 program that draws a 2D vector sketch on a Panel on a UserControl on a TabPage control. The data that creates this sketch already exists, so when the app is started the sketch is rendered on an unselected Tab. When the user selects the particular TabPage, the Sketch does not sho...more >>

Transform/Matrix
Posted by cadaha at 10/5/2006 7:15:35 PM
Hi I have a small problem that I am trying to overcome. I have seen Bob's article on Transformations and believe that this is the right direction to head. I have a screen with four images of 3 different sizes. top image smallest, left and right equal size and the bottom image the largest...more >>

How to draw image reflection
Posted by Jean-claude at 10/5/2006 4:53:35 PM
hello everybody, Since this morning i'm looking to try to draw an image reflection (fashion of the moment) like found on this page: http://cow.neondragon.net/stuff/reflection/ I have a gradient in background, i copy the original image, then copy inverted image but there is no gradient fad...more >>

problem with printing multipage tiff
Posted by mati at 10/5/2006 12:26:36 PM
Hi I have problem with printing tiff images containing more than one page. Problem is that there's the same frame on every printed/previewed page. This is how I do the printing: private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { int...more >>

Rotate bitmap 90
Posted by Le Minh at 10/5/2006 12:00:00 AM
I wrote a program to rotate a bitmap 90^, but this's not work. I dont know why! private Bitmap Rotate(Bitmap srcImg) { int width = srcImg.Width; int height = srcImg.Height; int newHeight = width; int newWidth = height; BitmapData srcData = srcImg.LockBits(new Rectangle(0, 0, ...more >>

Bilinear ?
Posted by Le Minh at 10/4/2006 12:00:00 AM
Can anyone explain for me about bilinear filtering ? ...more >>

Convert GIF to JPG - Quality Loss
Posted by RG at 10/3/2006 8:44:52 PM
Hi, I'm converting images from Gif to JPG. It works well, except i have a big quality loss in the new jpg file. This is my code, can someone explane me how i can increase the quality? oImg = System.Drawing.Image.FromFile(path + ".gif"); oImg.Save(path + ".jpg", ImageFormat.Jpeg); oIm...more >>


DevelopmentNow Blog