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 > april 2005

Filter by week: 1 2 3 4 5

Drawing Multiple Polygons
Posted by Chris at 4/30/2005 6:40:02 PM
I have a program that displays a map in a picture box. In the program I have commands that allow the user to draw polygons on top of the map. Problem is, when I go to draw a second polygon, the first disappears. I know I shouldn't use the picture box Paint method, but currently I am. A...more >>

Need faster bitmap compare method
Posted by a tocco at 4/30/2005 5:21:20 AM
Hello, Sorry if this is a double post. I dont think my first one went through. I am trying to improve my current code with hopefully a more optimized way. Hope someone can help. I am taking two bitmaps and comparing them, region by region, and returning the regions that dont matc...more >>

restore previous color
Posted by gv at 4/29/2005 6:15:23 PM
Hi all, I can draw a rectangle and fill with the code below: before drawing another one at a different location how do I restore the orginal color at the location? Public Sub DrawRectangle(ByVal StartWidth As Single, ByVal StartHeight As Single, ByVal Width As Single, _ ...more >>

Traverse multiple icon resolutions
Posted by Jeronimo Bertran at 4/29/2005 2:51:48 PM
How can I traverse and manage an Icon which contains multiple resolutions? I have and Icon that contains a 32x32 and a 16x16 format of the image and I need to work with a particular format. Thanks Jeronimo Bertran...more >>

Creating a graphics class on a timer and on it's own thread
Posted by gv at 4/29/2005 12:31:09 PM
Hi all, New to graphics. I'm sure this is a simple question. I want to create a class that I can pass in a control or form and it will draw an rectangle on that object that I pass in to the class. I know the code is wrong that I'm posting, can someone please help. I think looking at th...more >>

How can i detect if a given image is b&w monochrome or colour with c#?
Posted by gogogadgeting NO[at]SPAM hotmail.com at 4/28/2005 7:16:58 AM
Hi, can anyone help me. I need to find out if a given image is colour, B&W or monchrome programatically using c#. Can anyone help me. At the moment, I am using the System.Drawing.Imaging namespace. I'm having to create a bitmap object of my image and using GetPixel to return me the RGB colour...more >>

How to get Screen Graphics
Posted by Sanjay at 4/28/2005 12:00:00 AM
hi all, I want to be able to draw on the screen.Earlier We could do so by obtaining HDC of the screen as GetDC(0) and the drawing on it. Is there any alternative for it in .NET. Please give me some pointer on the same. thanks sanjay ...more >>

How to give parameters to the paint event handler
Posted by György at 4/27/2005 2:47:40 PM
I would like to place a character to different points ( X and Y coord) on a graphics screen. I use the paint event handler to draw my graphics but can not update the screen with new co-ordinates where I want to place a new character. Does anybody knows how to submit the parameters to a paint...more >>



Mouse Capture
Posted by Sanjay at 4/27/2005 12:00:00 AM
hi, could anyone please tell me how to capture mouse in Windows Forms.I want something equivalent to SetCapture and ReleaseCapture in ..NET framework. Thanking you. sanjay ...more >>

AntiAliasGridFit does not work all the time
Posted by Dipsy Po at 4/26/2005 2:27:07 PM
I want to draw text with both anti-alias and grid fitting for good quality. However, I found that sometimes .NET will not draw the fonts with anti-alias, even if AntiAliasGridFit is used. An example is Times New Roman Bold Italic at 12 point. It seems you need at least 14 or 15 points for ....more >>

A Graphics object cannot be created from an image that has an inde
Posted by Chris Davoli at 4/26/2005 1:24:04 PM
Why am I getting this message? I get it on both BMP's and GIF's. Do I need to convert before I create my BitMap? See code below. A Graphics object cannot be created from an image that has an indexed pixel format. Description: An unhandled exception occurred during the execution of the c...more >>

Adding elements at form c#
Posted by Piotrek \ at 4/26/2005 12:00:00 AM
I have a few lines of code: First i'm trying to start new thread: starter1 = new ThreadStart(akcja); t1 = new Thread(starter1); t1.Start(); After that i'm trying to paint something on the form: public void akcja() { ln = new Line(); ln.X_Left = a; ln.Y_Left = a; ln.X_Right = 100-a; ...more >>

Draw image on panel c#
Posted by Piotrek \ at 4/26/2005 12:00:00 AM
I have small problem. I'd like to make aplication for windows ce with one form and 3 panels (i supposed that this will be the best) using threads. Unfortunetly i have huge problem, i don't know how to make my program to draw anything on panel. I'm using this code: Graphics grfx = panel1.Creat...more >>

Is there ClipCursor equivalent in .NET ?
Posted by Sanjay at 4/26/2005 12:00:00 AM
hi, I need to confine my mouse cursor to particular area on the screen. I used to use ClipCursor API in VB6. can anybody please suggest me its equivalent in .net framework if any ? I will be thankful to u for the same. sanjay ...more >>

Bitmap not Painting
Posted by dale.thayer NO[at]SPAM netzero.net at 4/25/2005 9:51:01 PM
I read Bob Powell's GDI+ for Beginner's, but still cannot get the bitmap to paint. I am reading several RGBA images from disk, converting to bitmap, and then trying to paint each one after it is read from disk. (Bob, thanks for help on getting this far.) Advice? Code below (some code left out...more >>

Byte order for ARGB and Bitmap
Posted by dale.thayer NO[at]SPAM netzero.net at 4/25/2005 10:31:29 AM
Hello, If I load an image (640x480 pixels) from disk (32bpp) that has the bytes ordered as ARGB for each pixel, and load them into the data section of a bitmap, and then display it doesn't look correct. Is the byte order of the bitmap different? Example code below for reference: picture =...more >>

Client side dynamic graphing problem
Posted by Nevets Steprock at 4/25/2005 12:00:00 AM
I am familiar with application programming, but only started web-programming a month ago. I want to have a graph on a webpage that the client can click on and interact with. Specifically, I want the client to see a bar chart with three bars each representing a different quality (for ease of expl...more >>

Write text on multi-page TIFF image
Posted by Prasad More at 4/25/2005 12:00:00 AM
Has anyone developed a program using C# which writes text on a multi-page TIFF image i.e. open TIFF image, write text on it's first page and then save it with rest of pages. From http://www.developmentnow.com/g/20_2005_2_22_0_0/dotnet-framework-drawing.htm Posted via DevelopmentNow.com Groups ...more >>

32bppArgb Bitmap from Icon File, Please help
Posted by Mike at 4/25/2005 12:00:00 AM
I am loading an Icon .ico that contains 16x16 24x24 32x32 and 48x48 XP Icons with alpha transparencies. Then I am trying to save each Icon size as a PNG with the alpha transparency intact. I have tried the following methods but none maintain the Alpha Channel Data, it all goes to 255. 1) ...more >>

Problem with Palette's, ARGB, bitmaps
Posted by dale.thayer NO[at]SPAM netzero.net at 4/24/2005 9:48:02 PM
Hello, The following code complains that "Index was outside the bounds of the array" for the line inside the for loop that assigns the Color to the palette. Any suggestions: currentBitmap = new Bitmap(640,480,System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Imagin...more >>

Missing Pixels?
Posted by VR at 4/22/2005 8:44:56 PM
Hi, I'm trying to draw an image from scratch and I got some "pixels missing" when the image is drawn. I put a PictureBox in a form and the code bellow in the Form_Load event. I cannot get (for example) the red pixel show... PS: the red pixel is an example, there's some other pixels that do...more >>

String deletion from graphics
Posted by György at 4/22/2005 2:19:02 PM
I need to delete a string from a graphics. I wrote my string with DrawString in blue color than tried to redraw it with black color and the background is also black. I would expect that my original string will disappear but this deletion is not 100%. There are several pixels with a low intensi...more >>

How to convert image from Format1bppIndexed to Format24bppRgb?
Posted by blackcarrera NO[at]SPAM hotmail.com at 4/22/2005 12:52:45 PM
All of my images that are 24bppRgb are also about 41MB in size, 10000x10000 pixels are fine when I make calls to FromImage, DrawImage, etc. It's only when I try to convert the 1bpp to 24bppRbg that I run into the problem when I make calls to DrawImage (in the process of trying to convert pixel f...more >>

Invalid Parameter Used. at System.Drawing.Image.Save
Posted by Prasad More at 4/22/2005 12:00:00 AM
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at System.Drawing.Image.Save" error. public void addAnnotationStampOnImage() { string strStamp = Pat...more >>

How to convert image from Format1bppIndexed to Format24bppRgb?
Posted by blackcarrera NO[at]SPAM hotmail.com at 4/21/2005 11:45:22 AM
Hi, I'm trying to convert an image with PixelFormat Format1bppIndexed to Format24bppRgb. I keep getting the "Out of memory" message. Here's what I've tried:( (where bm.PixelFormat is Format1bppIndexed) 1) bm2 = New Bitmap(bm.Width, bm.Height, PixelFormat.Format24bppRgb) g2 As Graphics = G...more >>

Using DrawImage to resize image
Posted by Andreas Zita at 4/20/2005 12:15:08 PM
Hello! Im trying to resize an image using DrawImage but I keep getting annoying borders of the bitmaps background color, just barely visible but still there .... I have tried using different settings for CompositingMode, CompositingQuality, InterpolationMode and PixelOffsetMode but the bord...more >>

Fixed Header Rectangle
Posted by Martijn Bresser at 4/19/2005 9:34:12 PM
I want to draw a fixed header on a ScrollabeControl in C#. When scrolling I want to draw the Rectangle (= Fixed Header) always at the top of the visable area, so it will look like that the rectangle is not scrolling. Does anyone knows how to do this. Regards, Martijn Bresser ...more >>

Text with varying layouts
Posted by AndyNY at 4/19/2005 4:08:34 PM
I am not sure if I need to utilize GDI+ here. I need varying lines of text displayed vertically centered. I basically have a display that varies depending on what options are chosen. The first line is RED BOLD and size 16, the next line the same, the next two are black and 14 and the last 2 ...more >>

image slicing tool
Posted by g1ga at 4/19/2005 12:00:00 AM
I have to write some piece of c# code for study purpose. In particular, i need to reproduce an "image slicing tool" like the one in adobe photoshop and image ready. Can you help me about the algorithm needed? Or maybe you can suggest me some existing code. Thanks for advice! ...more >>

DrawString text quality
Posted by Barguast at 4/18/2005 12:52:02 PM
Is it possible to make DrawString draw text in the same way as the Label control? No matter what settings I use (StringFormat, TextRenderingHint, etc), it never has the same quality. I've tried looking at the source for the Label control (in particular the OnPaint method) but I'm still havi...more >>

pocket pc's apps in c#
Posted by Dania at 4/17/2005 12:00:00 AM
i'm working on a PDA project and i need help of how i can program a folder which contains sub folder..10x for ur hel From http://www.developmentnow.com/g/20_2004_2_0_0_0/dotnet-framework-drawing.ht Posted via DevelopmentNow.com Group http://www.developmentnow.com...more >>

System.Drawing.Graphics
Posted by DBC User at 4/15/2005 12:39:16 PM
Hi All, This is a very basic question. I am using .Net IDE 2003 and System.Drawing.dll (1.1.4322). I wrote a simple program like this (ommitting the commons) using System.Drawing; .. .. .. private void button1_Click(object sender, System.EventArgs e) { Graphics graph =3D new G...more >>

Managed memory corruption
Posted by markusszil at 4/15/2005 10:21:03 AM
Hello all, Has anybody encountered memory corruption issues of the built-in bitmap classes? My application occasionally crashes in very bizarre manners - references in managed objects are corrupted. Sometimes .net is able to recover into the debugger, sometimes the OS catches it. Occasional...more >>

GraphicPath.Contains(PointF)
Posted by Brecht Yperman at 4/15/2005 5:46:05 AM
Hi, I can't seem to find any methods to check whether a point is contained within a GraphicPath. You can get the bounds, but that's not good enough. Is there a method? Or any piece of sample code? Thanks, Brecht...more >>

Reading a portion of an image
Posted by David at 4/15/2005 12:00:00 AM
Is there a way to just read and write just a portion of an image. I have some large images that I want to manipulate but I dont want to load the whole image, is there a way to just extract the pixels that I want when given an x/y coordinate. David ...more >>

Library for image manipulation
Posted by Pino at 4/15/2005 12:00:00 AM
Hi to all. I'm looking for a library for image manipulation in .NET (red eye removal, auto levels, sepia, mosaic, etc.) Any ideas? Thanks, Pino. ...more >>

Hight Resolution Picture Scaling down
Posted by Jayleen via DotNetMonster.com at 4/13/2005 9:41:35 PM
Hi all, I have a very high resolution picture taken with a 4 Mega pixel camera, When i try to make it to a width and height of a business card, It does not scale down approprioately, it has lots of lines and looks as if the picture is not taken properly, ia m doing this using a picture box, ho...more >>

Multipart Tiff/Response.OutputStream
Posted by Jared at 4/12/2005 9:16:04 PM
Hello all, I want to display multipart tiff images in a web browser using the response.outputstream. I know how to do it with any other image type, but, when I run into the tiff I get a generic gdi+ error. How do you send the entire tiff image to the response.outputstream??? TIA, Jared ...more >>

GetHicon - Generic error in GDI+
Posted by Brian Hampson at 4/12/2005 1:55:37 PM
I call the following function regularly in my code to change the colour of a notifyIcon based on a condition. After some time, it crashes with Generic error in GDI+ Can anyone see the problem? private Icon DrawIcon(System.Drawing.Color colour) { Bitmap bmp = new Bitmap(64,64); Gr...more >>

ASP.net thumbnails
Posted by asad at 4/12/2005 4:12:02 AM
Hello friends, i have a images folder in which my uploaded images are stored i want to create thumnails of these images dynamically and show these thumbnail for example i have a folder named (cards) and in this folder for example this folder contain 10 images now i want to create a logic that ...more >>

Drawing a border over a image
Posted by Jayleen via DotNetMonster.com at 4/12/2005 12:00:00 AM
How can i take a image and draw a black border around it lets say of 2 pixels and place the whole thing on another image. Any help would be appreciated Jayleen -- Message posted via http://www.dotnetmonster.com...more >>

Drawing in Form
Posted by Richard Sharp at 4/11/2005 10:37:46 AM
I am not sure what I am doing wrong in this rather simple code. I am trying to draw an image of some specialized data onto a form. The program below is a simplified set of data similar to the type I'm drawing. The problem is that when I click on the button to display the data, sometimes it...more >>

DrawImage bug?
Posted by dkturner NO[at]SPAM gmail.com at 4/11/2005 7:52:23 AM
Hello I tried this: g.DrawImage(icon, 0, 0, new Rectangle(0, 0, icon.Width / 2, icon.Height / 2), GraphicsUnit.Pixel); Since the framework SDK docs state quite clearly that a "portion of the unscaled original image" is drawn to screen, I was most surprised when I...more >>

Hi I want to know how to draw a design surface for drawing my obje
Posted by Tushar at 4/11/2005 7:41:02 AM
i read this articl http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/designsurface.asp I wanted to add a design surface like this in my application also. i successfully did but am unable to manuipulate it properly. Like showing scroll bars, print area, etc. Can s...more >>

Converting an image from CMYK to RGB
Posted by Alan Lambert at 4/11/2005 12:00:00 AM
I'm new to imaging and need to write a routine to convert images (using .NET 1.1). I've got it to resize the image, change its resolution and save it in a different format but I haven't been able to figure out how to change it from CMYK to RGB. Can anyone help? Many thanks Alan ...more >>

Multithreaded IntPtr Hdc problem - Common or obscure error?
Posted by James Russell at 4/10/2005 6:55:38 PM
I am currently having a problem in a multithreaded application. It leverages a utility function takes a window, and gets a picture of a portion of the screen through a BitBlt. Occasionally (once every 500 calls or so), I get an InvalidOperationException - "The object is in use elsewhere." I h...more >>

Recommendations for improving bitmap display speed
Posted by Dave Rayment at 4/10/2005 2:55:02 PM
Hi, I'm working on an emulator at the moment, and I need to update the display 50 times a second. I'm using a 16-colour indexed bitmap, and generating it is no problem (I'm using LockBits/UnlockBits and writing the data directly using a lookup table). However, when it comes to outputing the...more >>

ArgumentException @ Image.FromStream(stream)
Posted by halise irak via .NET 247 at 4/10/2005 1:35:17 PM
I get an "ArgumentException: Invalid parameter used at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement)" exception. it is too ridicilious to get such an exception, can anyone see what might cause that exception? (By the way, i am trying to throw the he...more >>

showing ASP.NET thumbnails
Posted by asad at 4/10/2005 5:19:02 AM
Hello friends, i have a directory in which my uploaded images are stored i want to create thumnails of these images dynamically and show these thumbnail how can i do this pls tell me about that. Thanks...more >>

drawing tools: single use or durable
Posted by maxx at 4/9/2005 8:27:03 PM
A beginner's question: for drawing tools like pen or brush, should they be created and disposed everytime they are used or saved for multifple use. e.g. protected override void OnPaint(PaintEventArgs e) { using(Pen pen=new Pen(Color.Green)) e.Graphics.DrawLine(pen,0,0,100,100); } or ...more >>


DevelopmentNow Blog