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 > january 2006

Filter by week: 1 2 3 4 5

How do i add scroll bars to a Bitmap
Posted by makdtripper NO[at]SPAM gmail.com at 1/31/2006 2:10:57 AM
I create a bitmap image. I can draw and save it successfulyl...i need to know how to resize the bitmap when i add more and more drawings...or how to add scroll bars to a large created bitmap. My basic problem is to add scroll bars to a bitmap. ...more >>


Drawing multiple polygons
Posted by bmc99 at 1/30/2006 3:32:27 PM
In GDI there was a function called PolyPolygon that would draw an array of polygons. I cannot find an equivalent function in GDI+. Am I missing something? There is a function called DrawPolygon but drawing one polygon at a time is too slow for my purposes....more >>

DrawImage with sharp edges
Posted by Andreas Zita at 1/28/2006 12:03:13 PM
Hi Im using DrawImage to resize large images to smaller ones. I use InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic to obtain a good downsampling of the pixels in the image. However no matter what I do I get visible black lines (or whatever background...more >>

GDI+ and hardware
Posted by Jon Shemitz at 1/27/2006 1:11:48 PM
Why, after .NET has been out for so long, is GDI+ still not supported in hardware? -- <http://www.midnightbeach.com>...more >>

Rendering maps within .NET
Posted by Valerie Hough at 1/27/2006 10:16:56 AM
Hi, I used to use GDI under VC++ before .NET to render maps (lots of polylines, polygons, and rotated fonts). I currently have VS 2003 and .NET v1.1. I am interested in finding out what my best approach to this is within the ..NET framework. I presume that I could simply use DllImport to ...more >>

Tiled background images
Posted by Israel at 1/27/2006 5:44:07 AM
I've created a user control that allows a users to pan and zoom a display. Originally I didn't know that turning AutoScroll on will actually automatically scroll the Background image property so I ended up writing all of the code in paint that copies my larger buffer into the client area approp...more >>

How to know which parts need invalidating?
Posted by Chris Y at 1/26/2006 11:22:36 PM
I have an application where for performance reasons I am Invalidating parts of a Panel depending which part of the Panel has been modified. I am doing fine until I have the application covered by other Windows applications. When another application covers my app, getting my application bac...more >>

Dot Net 2.0 Restrictions???
Posted by JK at 1/26/2006 2:18:02 PM
Is it true that from Dot Net 2.0 onwards >> Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service perform...more >>



Inconsistent DRAWLINE width.
Posted by Marc Michaels at 1/26/2006 2:11:53 PM
I'm trying to draw some lines to create a "barcode". My code as wide/narrow bars and wide/narrow spaces. For some reason, the width of my spaces is inconsistent. One narrow space isn't necessarily the same width as another. I think this has to do with the width of the bar it is following. A...more >>

Picture Box
Posted by JB at 1/26/2006 5:17:06 AM
I am starting work on a small graphic editor program. I need to be able to move picture boxes around at runtime on the form, so that at any one stage a single form could hold 5 or 6 picture boxes, all of which are movable. I am using VB.NET 2005, and any help would be much appreciated....more >>

new Bitmap(stream) question
Posted by Lloyd Dupont at 1/26/2006 12:00:00 AM
someone on the mailing list pointed out that the remarks section of this construct states: --- You must keep the stream open for the lifetime of the Bitmap --- However a very simple sample like that: -- using (OpenFileDialog ofd = new OpenFileDialog()) { ofd.Filter = "Image files|*.gif...more >>

A generic error occurred in GDI+ when converting a picture to png in a stream:
Posted by Martin Widmer at 1/24/2006 5:53:27 PM
Hi Folks In my object I am trying to implement a function in order to render the picture to XML (to generate RDL for SQL Server). That Function causes the error mentioned in the subject at the marked line. I read various articles about it but none of them seems to apply as I am not writing ...more >>

DrawImage Method ???
Posted by Raju Joseph at 1/24/2006 12:00:00 AM
Hi All, I am in the process of creating a usercontrol. The control has an Image property of type Image. If I select an Icon (Windows XP) and try to draw it using DrawImage, the icon is not drawn properly. But If I try to do the same using the DrawIcon method, it is draws correctly. ...more >>

1bpp to 8bpp grayscale smoothing (performance)
Posted by Anders Spliid Hansen at 1/24/2006 12:00:00 AM
I've got a bunch of scanned microfiches in 1bpp format, all rather big, about 6000 x 4000 pixels. Some of the fiches are in handwriting, and this is why I want to make an algorithm that converts and smooths them into 8bpp grayscale. After reading Bob Powells excellent "Understanding LockBits" ...more >>

Refeshing Property Values
Posted by Raju Joseph at 1/23/2006 5:51:30 PM
Hi All, I have developed a UserControl. The control has some properties, one being TextColor. Also, there is a ColorScheme property, and based on the ColorScheme selection, the value of the TextColor property changes. My problem is, at design time, the value of the TextColor property is no...more >>

Text question
Posted by Yoda at 1/23/2006 2:45:15 PM
Hi, I'm writing a program that allow the user to compose a photo card. The user put images and text on a panel rapresenting the card and the program generate a jpeg at a variable resolution i.e. 3000x2250 rapresenting what the user have composed. Now the problem is: how can I calculate the ...more >>

Region.IsVisible exhibit abnormal behaviour
Posted by Joshua Wong at 1/23/2006 9:26:03 AM
Hello, Recently, I've encountered a few cases where the method IsVisible in the Region class is returning incorrect result. The following is one of the many cases that I've encountered: public bool ExampleTestCase() { GraphicsPath gp = new GraphicsPath(); gp.AddEllipse(new Rectangl...more >>

Print Document
Posted by Charles A. Lackman at 1/23/2006 1:33:30 AM
Hello, I am creating a print document and it works well, but how do I make the print object only print pages 1, 2, 5? This is how I am currently building the print function. Private WithEvents docToPrint As New Printing.PrintDocument Private Sub Button1_Click .... ..PrintDocumentPages(i...more >>

What's new in System.Drawing 2.0?
Posted by Shawn B. at 1/22/2006 2:32:01 PM
Greetings, Is there anything new in System.Drawing for .NET 2.0? I'm having a hard time locating any direct information from google. Thanks, Shawn ...more >>

Path drawn rectangle not placed correctly?
Posted by **Developer** at 1/21/2006 1:28:35 PM
I create a path which is a rectangle defined by (1,1) and lower right at (10,7.5) Using a pen 1 inch wide I The outside of the rectangle is 1/2 inch from the left and the top. And 1 inch from the right and the bottom. Does that make sense? Can you tell me what the rules are? Is the...more >>

Indexed Pixel Format Exception
Posted by Calvin Willman at 1/20/2006 3:48:32 PM
I'm trying to create a Bitmap from a file (tried Gif, Png, Jpeg), but am getting folliwng exception. A Graphics object cannot be created from an image that has an indexed pixel format. How do I either deal with this changing the existing format when loading it in the Bitmap constructor, ...more >>

Image.Save() problem
Posted by Lloyd Dupont at 1/20/2006 3:57:45 AM
I'm a bit puzzled, I probably did something wrong, anyway just checking. Should the code below work? I get a generic GDI+ error on Save() ?!? (EncodeParameter null ?!?) Note: this code is executed in a web server. Bitmap bmp = new Bitmap(width, height, PixelFormat.Format32bppArgb); // init...more >>

Mouse Click on Graphic Image
Posted by Duane at 1/19/2006 7:21:04 AM
If I create draw several images (ex: fillrectangle), is there any way of determining if a particular rectangle has been clicked? Thanks Duane...more >>

REGION'ing a button based on the Outline of an image ...
Posted by Vipul Pathak at 1/18/2006 6:53:29 PM
Hi, In an application, I want to make my buttons some thing like this: 1) Draw an Image (with some background areas within it) on all buttons. 2) REGION the buttons, such that only the ForeGround area responds to mouse clicks and the Background area isn't visible. Any Idea for any one, ...more >>

Inverting Text
Posted by Mario Vázquez at 1/18/2006 12:03:26 PM
Hi, I've wrote a progress bar control and i'm trying to write the percent progression into it. I would like to do that the percent text change its color while de progress bar is passing over it. Is there any easy way (or not) to do this? Tanks, MVR ...more >>

Drawing on a MonthCalendar control
Posted by David Veeneman at 1/17/2006 7:13:25 PM
I want to draw on a MonthCalendar control. I see that the control has a CreateGraphics() method, so I can get its Graphics object. But I can't find a suitable event to hook into to do the drawing. Does anyone have any suggestions, or can you point me to an example? Thanks in advance. -- D...more >>

image quality problem
Posted by ex-neo-con NO[at]SPAM bonbon.net at 1/17/2006 5:58:26 PM
I've been attempting to draw a simple equilateral triangle with 10 tick marks on each side. I'm able to draw one that looks fine on a monitor, but the same triangle looks lousy when I print it. What am I missing? Here's the code: Bitmap bmp = new Bitmap(600, 600); Graphics g = Graphics...more >>

BUG: Gdiplus Metafile GetHENHMETAFILE returns HMETAFILE instead of HENHMETAFILE for ALDUS Placeable Metafiles
Posted by Michael Phillips, Jr. at 1/17/2006 4:26:51 PM
The MSDN documentation for Gdiplus states that GetHENHMETAFILE returns a HENHMETAFILE handle. However if the Metafile was created with an ALDUS Placeable Metafile, then GetHENHMETAFILE actually returns a HMETAFILE handle. Because of this undocumented behavior, CopyEnhMetaFile, Metafil...more >>

create a clone of an existing Bitmap without using the clone method.
Posted by **Developer** at 1/17/2006 3:05:05 PM
DrawImage(Image, Point) Draws the specified Image object, using its original physical size, at the specified location. I just want the image drawn on the bitmap with the new pixels simply a copy of the old pixels. That is, pixel for pixel, the original and the drawn images should be the...more >>

Does Image.FromFile alway produce a bitmap no mater the format of the file?
Posted by **Developer** at 1/17/2006 2:17:48 PM
If the files not a metafile does Dim zz As Image = Image.FromFile(imageFileName) ' always produce a bitmap no mater the format of the file? thanks ...more >>

PrinterSettings: SetHdevmode/SetHdevnames
Posted by MLM450 NO[at]SPAM hotmail.com at 1/17/2006 1:14:00 PM
Does anybody know how to get these functions to work properly? I have an unmanaged C++ program that presents a print dialog and then passes my C# program the DEVMODE and DEVNAMES handles. When I try to use them in SetHdevmode and SetHdevnames, I get incorrect results. For example, the printer ...more >>

Marshal.Copy and copying a Bitmap
Posted by Jerry Q at 1/16/2006 6:14:56 PM
Hello, Where could aI find a sample code which would show how to use Marshal.Copy to copy a "graphics image" to pixel based image? There is a MS (really) quick supportpage for that http://support.microsoft.com/kb/814675/en-us but it is too approximate for anything. Cheers! ...more >>

Changing Font mid line
Posted by John Toop at 1/16/2006 3:48:58 PM
Hi, there. I was wondering if anyone has any ideas about how to change fonts. I'd like to display text such as the following (pretend you understand html) Mary had a <b>little</b> lamb. Here are the steps as I see them. Tell me if I'm missing something much simpler please. 1-Setup a R...more >>

Question about the OnPaint method
Posted by MariusI at 1/16/2006 9:05:02 AM
Can somebody explain why the client-rectangle which should be repainted is provided as a member of the PaintEventArgs instead of the clip region of the graphics object? Bonus question: what is the int-value of the CS_OWNDC style?...more >>

Printint
Posted by Microsoft at 1/14/2006 6:21:29 PM
I'm trying to print a image with PrintDocument Class, i create the eventHandler of printpage and draw bitmap with the Graphics object, but my problem is the next. I have a 300ppp jpg image and i want it to draw using Graphis object but when i load the image and draw inside the Graphics using ...more >>

Why so much trouble with ellipses?
Posted by Nathan Sokalski at 1/13/2006 3:00:56 PM
In a recent post of mine I mentioned the inaccurate shapes drawn by FillEllipse. In the response that I recieved I was told that DrawArc had less problems, which I found to be true (I have been using DrawEllipse, but they seem to have the same results when drawing a complete 360). However, e...more >>

new Bitmap(string) permanently locks file... but not always
Posted by SharpCoderMP at 1/13/2006 2:50:25 PM
hi, i'm having problems with the Bitmap construtor. The documentation states that when i create new Bitmap object from a file the the file gets locked until bitmap is disposed. I've been trying to avoid having locked file for the app's lifetime. I've tried something likie this: using (Bitma...more >>

Is Transparency Mask Possible?
Posted by lwhitney NO[at]SPAM yahoo.com at 1/13/2006 12:52:43 PM
Hello, Have been trying to figure out if there is any way in .NET to draw a GDI+ image using a transparency mask. For example, say I have a normal Bitmap 800x600 of a person walking on the beach. Instead of drawing the entire image, I want to draw only a part of the image defined by say,...more >>

Component for the fastest creation of multipage tiffs
Posted by Jay at 1/13/2006 7:57:40 AM
Hi, I'm looking to speed up my programs that combine tiffs. I'm currently using Informatik's TiffDLL50 ActiveX component which works great but I'm investigating alternatives that might be faster. I've modified samples I found at CodeProject and at Bob Powell's site, but I found these prog...more >>

PixelFormat.Format8bppIndexed in Bitmap Hangs!
Posted by Mil at 1/12/2006 11:35:54 PM
Hello, I'm trying to convert Images using Bitmap class. I want to use different options for example reduce the size of image. In my code I tried to create a Bitmap class instance with a Bitmap's constructor: new Bitmap(source.Width, source.Height, PixelFormat.Format8bppIndexed); ...more >>

Graphics Rotate Transform
Posted by jjbutera NO[at]SPAM hotmail.com at 1/12/2006 2:11:18 PM
I think what I want to do should be relatively easy, but I can't seem to come up with the proper values. 1. Take an image and resize to a specific W and H 2. I want to rotate the image 10 degrees counterclockwise 3. I want to paint the image into a new image so the upper left corner is at a s...more >>

Get Hex value from System.Drawing.Color Name
Posted by bill NO[at]SPAM internetbazar.net at 1/12/2006 12:08:17 PM
Can somone enlighten me? How do I get the hex value from a named color? I want to print it into a table: using System.Reflection; Type type = typeof(System.Drawing.Color); PropertyInfo[] properties = type.GetProperties(); foreach (PropertyInfo p in properties) ...more >>

GDI Error
Posted by Demetri at 1/12/2006 9:19:04 AM
Can someone tell me why I'm getting the error: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. I'm getting the error on the line that does the Save (last line in the code below). I have three images. The first image is the canvas - it is lots bigger tha...more >>

Get color depth of an icon
Posted by Pizzi at 1/12/2006 5:40:50 AM
Hi does anyone know how to get the color depth of an icon ? I tried converting it to a bitmap (Icon.ToBitmap().PixelFormat) but it always gives 32 bpp ARGB, even if I loaded it from an Ico file of an icon with only 8 bpp. Does anyone have an idea or suggestion ? Cheers David ...more >>

PrivateFontCollections and PrintPreview controls
Posted by Bryan Kinkel at 1/11/2006 10:01:33 AM
I am having a heck of a time getting a Printing.PrintDocument and a print preview control to use fonts in a private font collection. I've got a simple form that contains a textbox (for the TTF file path), a label and a Print Preview control. On load, the form adds the TrueType file to the P...more >>

GDI+ is not pixel perfect
Posted by FrankVDL NO[at]SPAM gmail.com at 1/11/2006 8:45:28 AM
Hi, A simple test, override the OnPaint method of a form protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.DrawLine(new Pen(Color.Black), 10, 10, 15, 10); e.Graphics.DrawLine(new Pen(Color.Black, 2), 10, 15, 15, 15); } Writing this code you shou...more >>

storing an image?
Posted by Greg at 1/10/2006 12:39:03 PM
I have a windows application that uses a few "base" images. I call them base images because my code only loads these images up once, and during the course of user interaction, create new images (based on the existing ones) , manipulates them, and draws them on the screen. All of this cod...more >>

Dpi problem
Posted by Lloyd Dupont at 1/10/2006 11:20:47 AM
I'm porting a MacOSX application to Windows. On windows I'm mainly using .NET (and a bit of GNUstep as well). Anyway this application has a lot of image resource. Whenever I display this picture on Windows with graphics.DrawImage(img, x, y); the image get scaled (grow) and blurry. how come...more >>

Including HTML When Outputing a Dynamically Drawn PNG
Posted by hi NO[at]SPAM there.yo at 1/10/2006 9:21:10 AM
I have a web page that's taking in data from text boxes, drawing a chart to represent the data, and then outputting the chart in PNG format. What I cant figure out how to do, is to output the chart as part of an aspx web page. Ideally, I'd output it to the bottom of the web page that the ...more >>

Scrolling OwnerDrawn Controls
Posted by Shmarya at 1/9/2006 10:36:45 PM
Hi, I have an issue I've been battling with for a few weeks. I've tried to describe it in as much (relevant) detail as possible. I'd be grateful for any help! I have a control which has the following layout: - A toolbar docked to the top, - A content area filling the rest of the control...more >>


DevelopmentNow Blog