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

Filter by week: 1 2 3 4 5

Memory leak/problems when printing TIFF images (VS2005)
Posted by jasonw.mn NO[at]SPAM gmail.com at 6/28/2006 9:40:12 AM
Howdy folks, I am currently attempting to print a few thousand TIFF images, however, after ~1100 images I catch an exception saying, "Attempted to read or write protected memory...", or, "The handle is invalid". I am unable to continue printing until I restart the application and begin again. ...more >>


loading BMP in ARGB format - loosing Alpha
Posted by tb2000 at 6/28/2006 9:33:01 AM
How do I load a 32bit ARGB formatted bitmap into an Image object? I tried this Image.FromFile(path) but apparently I am loosing the alpha channel. If I export (by a tool) the BMP to PNG and load that file alpha is actually preserved? Any hint (P/Invoke?) is appreciated. tb...more >>

Layering in Windows Forms
Posted by vikash NO[at]SPAM nagarro.com at 6/28/2006 7:50:44 AM
Hi, I want to develop a windows based application using .Net 2.0 The application will have the heavy UI and it will have the lots of drawing to do on the form. So can any one give me the direction how can i handle the different issues that will arise in the same due to paint event and due...more >>

Bitmap rotation
Posted by sb at 6/24/2006 11:14:57 AM
Is there any relatively simple way to rotate a bitmap (PixelFormat = Format8bppIndexed) by say, 9 degrees? Thanks! -sb ...more >>

Drawing Graphics Over WebBrowser
Posted by Steve at 6/23/2006 1:06:01 AM
I'd like to draw some GDI+ graphics on top of a web page in a windows form application, but I can't seem to do it. The WebBrowser control hides the Paint event (and never calls the OnPaint method); and putting a transparent other control on top doesn't work because "transparency" of a control...more >>

There's no way to save a good GIF with VB.Net
Posted by Shadow Lynx at 6/22/2006 11:28:13 PM
Since there's no decent built-in color quantization for the .Net gif encoder (really, who in the heck uses the web-safe palette anymore?), we have to do it ourselves. This page: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/colorquant.asp provides the code t...more >>

PlayEnhMetafile in dotnet?
Posted by Ottar Holstad at 6/22/2006 4:47:55 PM
Hi, I'm trying to draw a metafile on top of another metafile using C# Express. I'm used to doing this with PlayEnhMetafile (and friends) in the Win32 API, using Delphi, but now I need to do the same in dotnet. The purpose is to see if a problem I have here is also present in dotnet, and ther...more >>

SetPixel is too slow for my needs
Posted by Frustrated at 6/22/2006 4:23:23 PM
I am using VB.NET and I am capturing frames from a camera. Since the data is coming to my app via an array of bytes and is 8 bit, I am using the following code to display it in a picturebox. Private Sub ConvertFromArrayToPictureBox(ByRef oPixBox As PictureBox, ByVal arrByte() As Byte) Dim...more >>



Drawing Solid and See Through Lines
Posted by Mark Collard at 6/21/2006 5:57:02 AM
I want to create a custom form (all drawn in the pain event) that is part solid (i.e. non see through) and part see through (e.g. 50% opacity). I've tried setting the BackColor and TransparanceKey colors to the same value and drawing lines with different Alpha color values. The lines with an A...more >>

Image.Save and ExternalException
Posted by David at 6/20/2006 8:57:45 AM
Hello: In a test app that reproduces a requirement of another app, I am trying to load an image from disk into a System.Drawing.Image object, and then read the bytes of the image object into a memory stream. The code is as follows... Image img = null; using (FileStream fs = new FileStr...more >>

How to do OnClick to AdjustableArrowCap
Posted by slatvick NO[at]SPAM gmail.com at 6/20/2006 4:55:34 AM
I found usefull way to draw arrows: http://groups.google.com/group/microsoft.public.dotnet.framework.drawing/browse_thread/thread/d909c2f68b245d25/6d5c2a8ccdb7f937?lnk=st&q=C%23+AdjustableArrowCap&rnum=1#6d5c2a8ccdb7f937 but I need to create kind of OnMouseDown on this arrows and don't know how...more >>

Question on Buffered Graphics
Posted by bern11 at 6/19/2006 12:13:28 AM
I created a BufferedGraphics object using the BufferedGraphicsContext->Allocate method, and I still get screen flicker. My paint method is simple enough: BufGraphics->Graphics->DrawImage(... BufGraphics->Graphics->DrawImage(... BufGraphics->Render(); When I use t...more >>

color pixels with differnet colors
Posted by gb at 6/17/2006 10:57:00 PM
hi, is there a way using GDI+ to fill a line ,rectangle or any other group of pixels with colors, but specify the color of each pixel (the colors of the pixels can be different) ? thanks. ...more >>

Covert Pixel to Point
Posted by sync at 6/17/2006 9:53:01 AM
Hi, How can I convert measurement in Pixel unit to Point unit? e.g., 10pixel = ? point Thanks. -- sync...more >>

GDI+ bitmap saving question
Posted by ZQ at 6/16/2006 1:24:53 PM
Hi all! Am I correct if I say that saving bitmaps using bitmap.Save("filename", ImageFormat.Tiff); is actually saving the bitmap in a separate thread, and that the "filename" file is not ready for reading immediately after the next line of the app code is processed? I'm having one ap...more >>

Color description
Posted by Samuel Shulman at 6/15/2006 10:44:53 PM
I would like to understand the meaning of these colour descriptions e.g.#E7E7FF or #4A3C8C Is it RGB and how it is represented within these description? Also does anyone know of any article that explains how to guess the RGB for a specific destination colour Thank you, Samuel Shulman ...more >>

How to capture image from WebBrowser control?
Posted by StartPixel at 6/15/2006 7:13:06 AM
Hello all, I need to develop a small application that browses webpages automatically and saves the images found on those pages. Probably you would say: iterate the HtmlElements collection, find the value of the SRC attribute, load each image using its corresponding URL and then save it. Th...more >>

Performance & new Pen() / new Brush()
Posted by Lloyd Dupont at 6/15/2006 12:00:00 AM
In my drawing code I recusrively create an average number of pens and brushes of, let's guess: 300? Would I see performance improvment by just caching those? (actually I use and create all of them in a using() statment) -- Regards, Lloyd Dupont NovaMind development team NovaMind Soft...more >>

A bug with PenAlignment ??
Posted by Laurent at 6/14/2006 4:54:54 PM
Hi I just make some test to see the effect of PenAlignment. And I noticed that: * using Graphics.DrawLine: no effect, it is always "Center" * using Graphics.DrawRectangle: Center and Inset are ok but Left, Outset and Right are always "Center" * using Graphics.DrawPath: same as DrawLine ...more >>

Fill an irregular shape with color
Posted by Sergio at 6/14/2006 6:51:03 AM
Hello, How do I fill an irregular shape with a given color in an image with System.Drawing? Let's say I have a map of North America and I want to paint the USA with a color given by my user. It's just like doing a fill with paint or photoshop right in the middle of the USA. Is there a way ...more >>

Graphics DPI is confused
Posted by Laurent at 6/13/2006 5:44:51 PM
Hi all, I have some trouble with the Graphics.DpiX / Y The value of DpiX and DpiY is the value configured in the "Display" configuration panel and is by default set to 96 dpi. So, my resolution is 1600x1200, I used a transformation and set pageunit to millimeters and then I draw a line ...more >>

modifying each frame in multiframe tiff and saving
Posted by manjunathsp via DotNetMonster.com at 6/13/2006 12:45:00 PM
Hi, I am writing a cheque (check) printing application, which draws the cheque on the front and back of a 6 X 2.5 dimension image. I have used a 2 frame tiff file (for front and back). For performance reasons I am creating a temp image file containing the basic cheque layout and trying t...more >>

Image.Save throws error
Posted by pavvu.akk NO[at]SPAM gmail.com at 6/13/2006 6:21:02 AM
Hi All, I'm doing a System.Drawing.Image.Save(filepath) but it gives me the error "A general error occured in GDI+". I did browse through many solutions but none worked. I'm doing this in the C# code that I'm writing to customize MS Word (COM Add-in). I even tried Bitmap.Save but it gives me th...more >>

LinearGradientBrush
Posted by Mike Batt at 6/13/2006 4:22:02 AM
I'm trying to draw a linear gradient between two colours using the LinearGradientBrush class. It sounds simple enough however I get a line of the second colour at the top of the gradient in certain situations. Placing the code below in the paint event of a Panel will hopefully demonstrate th...more >>

Fast "clearing" of Image pixels
Posted by windywinter at 6/12/2006 4:11:01 AM
Hi, I want to ask about fast "clearing" image to transparency color. Something like: FillRect(Brushes.Transparent, 10, 20, 16, 16), but because all new pixels are transparent then... all will be ignored. Generally I have buffer (Bitmap) object. This buffer is divided on tiles. At any time I...more >>

Read XMP (photoshop) metadate from file
Posted by Klaus Jensen at 6/10/2006 10:14:18 PM
Hi! I need to access the XMP-metadata stored by Photoshop in jpeg-files. I have been looking for a solution for hours on google, google groups etc et c Fields can be found here: http://www.portfoliofaq.com/pfaq/FAQ00311.htm And Adobe (who invented the format as far as I can tell) has create...more >>

GraphicsPath.IsVisible broken?
Posted by Mike at 6/9/2006 3:51:22 PM
The .NET class libary presents this as an example of GraphicsPath.IsVisible: Public Sub IsVisibleExample(ByVal e As PaintEventArgs) Dim myPath As New GraphicsPath myPath.AddEllipse(0, 0, 100, 100) Dim visible As Boolean = myPath.IsVisible(50, 50, e.Graphics) MessageBox.Show(...more >>

drawing text in grid cells
Posted by PJ6 at 6/9/2006 12:18:16 PM
OnPaint I need to draw the text contents of lots of grid cells. For it to look right, each cell's contents cannot be rendered outside the bounding rectangle of the cell. Only, DrawString does not allow me to specify a bounnding rectangle. Do I really need to create a new Region for each cell, ...more >>

1 bit image manipulation
Posted by Becker at 6/9/2006 9:31:02 AM
I have 1 bit CCITT 4 compressed TIFFS. I can save these efficiently, but as soon as I modify the image using the graphics drawstring method to stamp some text on the image, I have to convert the image to 1bit to get it to save back using the CCITT 4 compression. This operation takes severa...more >>

Program stuck when removing row from DataTable
Posted by Dagan at 6/8/2006 3:46:57 PM
Hello I have built a DataGridView that its data source is binded to a DataTable after adding it 200 rows I try to remove the first row and the program stuck, What could it be???? Thanks. ...more >>

Drawing outside the box
Posted by Randolpho at 6/8/2006 1:33:37 PM
As part of a custom animation initiated by a control on a form, I would like to draw outside the boundaries of the control or even outside the boundaries of its containing form. I can't do this using CreateGraphics on either the control or its parent form, and I'm trying to stay away from usin...more >>

Drawing a line at an angle in ASP.net
Posted by SurajPrabhu at 6/8/2006 3:58:02 AM
Hi All, I am tying to build a ASP.net 2.0 based web page which displays a Analog Guage ( 0 to 180 degrees) with an Arrow in the middle. The application accepts the Percentage as input from a text box and then generates an image which shows a Arrow pointer dipicting that percentage on ...more >>

ColorMatrix and ImageAttributes
Posted by JB at 6/7/2006 8:58:02 PM
I have created a program that displays different pictures on the form at the same time. When I have no ImageAttributes against the images, everything runs perfect and smooth. When I start adding ImageAttributes (greyscale, negative, etc) the program starts to slow down and lag. This is be...more >>

Draw using inverted colors
Posted by Chris Saunders at 6/7/2006 4:10:38 PM
I have a bitmap drawn on my form and I wish to draw an ellipse over it using the bitmap colors inverted. I used to do this using GetDC() and SetROP2(). Is there a way to do something similar using a Graphics object? Regards Chris Saunders ...more >>

Fast 1 bit conversion
Posted by Becker at 6/7/2006 1:07:02 PM
I have implemented Bob Powell's method for 1 bit conversions and am wondering if there is a faster way to do this? I am finding that in .NET 2.0 using this method, it is particularly slow. Have there been any improvements in the framework in 2.0 for dealing with images? Are there alternativ...more >>

multipage tif splitting problem in .net 2.0
Posted by timmitfi NO[at]SPAM hotmail.com at 6/7/2006 2:33:48 AM
Hi, I try to split multipage tif file to separate files using vb.net 2.0. To accomplish this I use the following code Dim sourceBitmapFile As New Bitmap("multiPageTiffFile") Dim saveCodecInfo As ImageCodecInfo = GetEncoderInfo("image/tiff") Dim saveEncoderParameters As New Encod...more >>

superpose bitmaps
Posted by Martin Hinterdobler at 6/6/2006 10:04:13 PM
Hi Newsgroup, for a project at high school I need to superpose 12 grayscale bitmaps into one Bitmap. For each Point P(x,y) in the resulting bitmap the grayscale value should be the arithmetic mean of all P(x,y) of the 12 bitmaps: Pres(x,y) = (P1(x,y) + P2(x,y) + P3(x,y) + ... + P12(x,y)...more >>

Show method of Panel is very slow
Posted by illegal.prime NO[at]SPAM gmail.com at 6/6/2006 7:16:02 PM
Hi all, I'm looking at trying to improve the performance of showing a bunch of controls on a panel. I have a class that extends Panel. In that class, I do the following: this.SuspendLayout(); this.Hide(); //add controls to "this" AddControls(); this.ResumeLayout(); this.Show(); I hav...more >>

Use of the MeasureString method
Posted by Samuel Shulman at 6/5/2006 10:01:00 PM
Hi Is it possible and to use the MeasureString method without the PaintEventArgs object Thank you, Samuel ...more >>

wrapper rectangle around a string
Posted by eduwushu at 6/4/2006 1:25:02 PM
Hi there, i have a string thatt i draw in the visible surface of a control with a specific font.Later i want to obtain the rectangle that wraps that string to put a background color to the string. I have tried to do it with measure string method but that method doesn´t give me the exact rect...more >>

How to determine if a BITMAP uses alpha transparency
Posted by tommaso.gastaldi NO[at]SPAM uniroma1.it at 6/3/2006 12:20:06 PM
Given a Bitmap object, I need to test if it is using alpha transparency. Any idea on how to quickly detect that (possibly something smarter than testing the pixels one by one) ? -tom ...more >>

Listing all GDI+ Brushes
Posted by arlef at 6/1/2006 11:09:01 AM
Hi There, Is there a way to list/enumerate all GDI+ Brushes? Thanks ...more >>


DevelopmentNow Blog