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 2004

Filter by week: 1 2 3 4 5

GDI+/GDI fails
Posted by Pascal Cloup at 1/30/2004 8:11:03 PM
Hello, In the process of animate an simple object (line, cross, ...) over an existing graphics, i use a method that create a bitmap of the background by making some calls to GDI (using interop to User32.dll) and draw the line with the GDI+ DrawLine method. When it's time to draw the line at a ...more >>


Graphics.DrawLine Throws "Out Of Memory" Exception ?!
Posted by Milen at 1/30/2004 7:17:19 PM
Hello, The following piece of code causes an exception in the DrawLine method. Tested it on different machines (XP and 2K), dotnet framework 1.1 To try for yourself you can just subscribe for the Paint event of a Windows Form and paste the code there. private void Form1_Paint(object sender, S...more >>

DrawString and "real" fixed width
Posted by Benjamin Lukner at 1/30/2004 2:58:12 PM
Hi! I've written an application on Pocket PC and now I'm trying to port it to Windows XP. The problem is that DrawString with "Courier New" does not produce monospaced text. Depending on the text size it produces for a string of many "W" no, one ore two pixels space between the letters. ...more >>

Drawing Rubber Band Line
Posted by kirang at 1/30/2004 12:44:17 PM
Hi All, I need a rubberBand effect in my application on the picturebox control so i have used a GDI instead of GDI+. ie API like SetROP2( hdc, R2_NOTXORPEN) and it is working fine. Now I facing a strange problem when i try to draw something greater than the values of the picturebox height, pi...more >>

Loading huge images
Posted by Morten Nielsen at 1/30/2004 10:42:44 AM
How can I load huge images and process them in C# ? These images are around 15000x15000 pixels, and needs to be processed pixel by pixel. Any pointers and ideas on how to handle the data effectively are appreciated. Regards /Morten Nielsen Email: http://www.iter.dk/contact.aspx ...more >>

XP Visual Styles
Posted by Mark Levison at 1/30/2004 7:56:05 AM
I would like to the use the XP Visual styles (UxTheme.dll) for custom controls and can't find any documentation that tells me about the contents of the dll. I've found bootstrap documentation and the Genghis code, that help me access what's available to buttons, but I'm unable guess what else is th...more >>

Text Size in the Font Object
Posted by Keith Rebello at 1/30/2004 7:53:02 AM
I want to be able to designate the usual point size for my text and then = draw it either on a printer or some screen element like a picture box. = For instance, after performing various coordinate transformations from = world coordinates to a picture box, I would like my text to look like = th...more >>

Can Bob Powell or anybody else help me
Posted by Saurabh at 1/29/2004 4:26:57 PM
Hi All, I had posted my message on the windows forms newsgroup and got a reply to ask you guys about the query. TIA, --Saurabh Try posting in the microsoft.public.dotnet.framework.drawing newsgroup. There are several people there who can help you with this. Specifically Bob Powell. ...more >>



Custom Control & Arrow Keys
Posted by Andrew Deren at 1/29/2004 11:01:11 AM
I have written a custom control that needs to do some action when arrow keys are pressed. All works well, until I add scrollbars to the form. When scrollbars are on the form, and I press arrow key, the control doesn't receive those keys, and instead scrollbars start blinking Is there some setting f...more >>

Drawing Text Problem
Posted by Keith Rebello at 1/29/2004 9:27:21 AM
I am drawing what is contained in a 500 x 1000 unit rectangle onto a = picture box "P1" using the graphics object (Gr) obtained from the Paint = event of P1. The rectangle has the y-axis pointing up. To achieve this I do the following: 'Reflect about the x-axis, scale about the origin and tra...more >>

InvalidPrinterException
Posted by Andrew Deren at 1/29/2004 8:41:11 AM
I've been having problems printing to one of the printers. I get: System.Drawing.Printing.InvalidPrinterException with detail: Tried to access printer NameOfPrinter with invalid settings. It doesn't tell what was the invalid setting. I tried going to page setup dialog and properties for printer an...more >>

Transparent background
Posted by Christian Halvarsson at 1/28/2004 9:38:09 PM
Hello. What im trying todo is the following: I have a panel with eg. blue background. I drag and drop two pictureboxes out to the panel. In the two pictureboxes i have drawn some graphics. for example an filled circle. When i then use the mouse to move these objects around inside the panel ...more >>

ActiveX Font property read-only in .NET?????
Posted by msnews.microsoft.com at 1/28/2004 6:04:00 PM
Hi, I am using an ActiveX created using delphi. It has a font property exposed. The font property is of type IFontDisp in the server(delphi). The font properties like Size, Bold, Underline etc has both 'Set' and 'Get' methods when using the activex in a VS6 app. But when using the activeX i...more >>

Scrolling canvas with antialiasing;
Posted by Matt Budd at 1/28/2004 5:22:25 PM
Hello.. I'm having a wierd thing happen with a scrolling canvas and anti-aliasing. Basically, when I use the Autoscroll property and set my smoothing mode to Antialising, I get weird lines when I scroll. The following code demonstrates it: using System; using System.Drawing; using Sys...more >>

how do I load a JPEG into a pictureBox?
Posted by rocio at 1/28/2004 3:58:11 PM
Yes, this is staright forward but this code does not work: PictureBox1.Image = new Bitmap("\SD Card\myfile.jpg") PictureBox1.Update() however if I load a specific BMP file it gets displayed. So how do I load a jpEG then? ...more >>

Creating document thumbnails
Posted by sklett at 1/28/2004 10:05:06 AM
Hi- I have a web based application and thought that it would be nice to include thumbnails of the document next to their listings on the web page. I have never done anything like this before and I'm not sure where to start. I think that most mainstream documents have embedded thumbnails like...more >>

Alpha Blending performance
Posted by Microsoft news at 1/27/2004 7:10:44 PM
This is an alpha blending performance question: I am using the .NET graphics.DrawImage method with ImageAttribute as documented, it is doing the alpha blending beautifully but the performance is very poor, especially when i'm blending several layers of 1024x786 sized bitmaps. Is there any b...more >>

Memory Issues -- Not Enough Memory Available -- in drawing App
Posted by Jeff Gress at 1/27/2004 2:26:09 PM
I have a TIF viewer I'm building in C# using the LEAD Tools toolkit, and I'm unable to view a 378KB file, although I'll need to view TIFs of up to around 2MB Using GC.GetTotalMemory I see that I have 765,008 bytes when I start my program and as I load each image the available memory actually incre...more >>

Nice colored progress bar draw
Posted by Crirus at 1/27/2004 10:37:44 AM
I need a rectangle progress bar that basicaly shows 3 colors and transitins between them So. for low values should show red, for middle values yellow and for max values green. I'm sure you know what I mean... The question is how to do that? -- Cheers, Crirus --------------------...more >>

4bpp image question
Posted by Todd A at 1/27/2004 10:00:13 AM
I need just a little guidance here; I have a TIFF image that is in 4bbp format This TIFF image has a Horiz Resolution of 240 ppi This TIFF image has a Vert Resolution of 120 ppi What I would like to do is simple Create a copy of this TIFF with H=240ppi and V=240ppi Essensially, just transf...more >>

metafile degradation
Posted by Eric Eggermann at 1/27/2004 12:38:36 AM
Hello, I'm serializing an image to a file, and upon deserialization, I'm seeing varying degrees of degradation in wmf files. I'm well aware of how raster objects can degrade when being resized, but I can't figure out what is happening to these metafiles. I've tested serializing the image to a...more >>

Internet source of GDI+ info in VB
Posted by Dave at 1/26/2004 11:20:00 PM
Hi all, Can anyone recommend a good reference source for using doing graphics in ..Net with examples in VB.Net (or VB-ASP.Net)? TIA, MC Dave ...more >>

Lockbit Exception??
Posted by sam NO[at]SPAM samdavies.co.uk at 1/26/2004 3:24:11 PM
Hi, I have been periodically getting the following error message when calling my lockBit function. An unhandled exception of type 'System.InvalidOperationException' occurred in system.windows.forms.dll Additional information: Bitmap region is already locked. It does not appear everytim...more >>

drawreversibleline in a picturebox
Posted by whon NO[at]SPAM umich.edu at 1/26/2004 7:52:37 AM
Hi all, I am now porting a vb6 program to vb.net In the Vb6 program, we can easily set the drawmode = vbinvert and draw reversible line on the picturebox. In Vb.Net, I found the similar function, but this function draws to the desktop. I am just wondering if any of your guys know a way ...more >>

PathPoints of GraphicsPath
Posted by Gawel at 1/25/2004 7:41:12 PM
I have GraphicsPath with many points. Let's name it path. A then I would like to change one of these points, path.PathPoints[0] = new PointF(path.PathPoints[0]+10, path.PathPoints[0]+10); but this above statement does not work. It means the value of path.PathPoints[0] does not change!!!...more >>

System.Drawing and GDI+ Question - Please help
Posted by padawan at 1/25/2004 4:52:30 PM
I have a winforms control that draws a rectangle for a boarder and positions some graphical elements around the control to create the boarder effect I desired. In the control I have overriden the onpaint event and added the code to draw my rectangle and position my graphic items: Protected Ove...more >>

Drawing a point
Posted by Siegmund Natter at 1/25/2004 3:52:59 PM
Hi In the help of Visual Studio I found methods how to draw ellipses, rectangles, beziers, and so on. But I found no method Grpahics.DrawPoint. To draw a simple point, do I have to draw an ellipse without a width and lenght or a line without an end point?? Thanks ...more >>

Drawing "On-the-top"
Posted by Jesper Olesen at 1/25/2004 2:04:16 PM
Hi, Ok, this is a bit tricky to explain. I just got my hands on an SDK that intergrates to a application running on my PocketPC. I am developing in C# and the Compact Framework. From my programming running in the background(myapp) which recives data and info from the application(thereapp) vi...more >>

Using GDI Drawing Lines on PictureBox Control in Paint Event
Posted by lee.ottaway NO[at]SPAM nuesoft.co.uk at 1/25/2004 9:03:24 AM
Greetings I'm using the GDI DrawLine statement to create graph like lines on top of a picture in a picturebox control in VB.Net. Now when I put this code in a button and press it, it draws the lines correctly as expected, however when you minimize the screen or move the screen in any way, th...more >>

Where is DrawFocusRect
Posted by Guilherme Martins at 1/24/2004 8:26:16 PM
Hello, I have an application that user drag object over the screen. In Win32 programming style, I have used DrawFocusRect when dragging. In .net, what should I use to get the same visual effect? Or how I draw a rectangle with xor pen mode? Thank's. ...more >>

How to measure string width?
Posted by David P at 1/24/2004 7:12:59 PM
The Graphics.MeasureString() function measures the width of a string on a particular drawing surface. Does anyone know *any* other way to determine string or character width? Preferably, I would like to measure the width of a string, in a particular font or font family, in a *device independ...more >>

Printer Units
Posted by David P at 1/24/2004 3:58:36 PM
I'm trying to figure out the number of pixels per inch on a printer and I'm getting really strange results. Using an "Info" textbox on a form, I got the following results from some test code (at the bottom of this message): height on screen : 12pt 18.39844 16pixels 18.39844 height o...more >>

Japanese Text with GDI+
Posted by Matt Pallatt at 1/23/2004 3:46:48 PM
hi all, would anyone care to tell me if it is possible to use GDI+ to render out japanese text as an image using GDI+? For all the methods i have tried, i have failed totally to make this happen -- i can get arabic, turkish, all kinds of none english characters sets to function perfectly, but ...more >>

Screen Capture Of Windows Media Player
Posted by Ivan Gibbs at 1/23/2004 3:44:46 PM
I am trying to get a specific frame from an mpeg and save that frame as a .png. My current test program is a modal window with a Windows Media Player in it. When the user presses OK, an entire screen capture is taken. I then get the frame by extracting that part of the screen capture. T...more >>

How to create and image from a piece of another image
Posted by Buddy Ackerman at 1/23/2004 1:53:40 PM
I guess what I would want is to simply copy a region of one image into a new image object. I can't seem to find any way to do that although I'm sure it's there. Also, what are some good resources (books websites) for learning how to use the Drawing tools in .NET? Thanks. --Buddy ...more >>

Any1 have a good example of ClipRectangle use?
Posted by Chris Adergaard at 1/23/2004 7:56:07 AM
I want to optimize my painting done in my custom controls I've tried using ClipRectangle to be able to only Invalidate (paint) the affected areas thus minimizing the time spent painting the controls but I think it can be done better since the time before spent on painting now gets eaten by the tim...more >>

color.fromargb in .net compact does not paint transparent
Posted by Jacco at 1/23/2004 12:05:57 AM
Hello, When I use the microsoft example below and run it, it produces 3 circles which are more or less transparent. When I use the exact same code in .net compact, I see 3 opaque circles. The MSDN information does not mention anything about not being able to draw transparent images. Can anybo...more >>

How do I draw into an 8 bit bitmap?
Posted by Ken Varn at 1/22/2004 4:59:59 PM
I have a GDI+ Bitmap object that has an 8 bit bitmap image loaded into it. I want to draw into this bitmap, but the Graphics.FromBitmap function indicates that it cannot be used on 8 bit images (A Graphics object cannot be created from an image that has an indexed pixel format). What method sho...more >>

MeasureString Difficulty
Posted by Ron Rohrssen at 1/22/2004 10:40:11 AM
Hello. I've been trying to solve a problem with printing a text document. I've got almost all of the problems resolved except this one. It seems that when I calculate the rectangle needed to draw my line on the page, the MeasureString method gives me a rectangle that is slightly too big. I...more >>

How to load cursor from resource?
Posted by Jens Weiermann at 1/22/2004 10:32:31 AM
Hi! I've created two cursor files (handopen.cur and handclosed.cur) and added these to my c# project. Now I want to load one of them (based on some condition) to assign them to a control. I figured I might have to use the 4th version of the Cursor constructor that gets passed a resource type ...more >>

How to draw a line between two points from different panels?
Posted by Robert H at 1/21/2004 11:31:05 PM
Hi all, I face this problem. I try to draw a line using GDI Drawline method between 2 points from different panels. Two point from the same panel is ok. In different panels, it is not work. please show me the way how to do. Thanks Robert H...more >>

Color Selection for LinearGradientBrush
Posted by mas32677 NO[at]SPAM hotmail.com at 1/21/2004 8:05:13 PM
Does anyone know how to calculate a reasonable gradient starting color from the SystemColors.ActiveCaption? For example, in Outlook 2003 it has a number of gradients that are based off of what appears to be the ActiveCaption. If you change your color scheme, it draws the gradients with the ne...more >>

Image in NON Rectangular area
Posted by Carlos at 1/21/2004 5:41:06 PM
Hi there! Does anybody knows if there is a control, technique or article that can help me in defining an image that has non rectangular area and then know if I already clicked on that area? regards Carlos ...more >>

Reliable way to retrieve a list of envelope paper types for a printer?
Posted by msnews.microsoft.com at 1/21/2004 12:43:52 PM
I'm trying to set a paper source, and would like to filter the list of available types to that of only envelope types (similar to Word, etc.) The solution thus far of checking the PaperSize.PaperName for "Envelope" seems pretty hacky, especially with localization in mind. Any suggestions are a...more >>

Can anyone please tell me how to outline Text?
Posted by Unknown at 1/21/2004 8:47:33 AM
Hi I'm looking for a way to just outline a label I have and I haven't been able to find any information about doing it. I tried actually making 2 labels, 1 being black and 1 being white and trying to make the black one slightly bigger and having the white one overlap, unfortunately it didnt ...more >>

Icons To Gif Issue..
Posted by Nigil LaVey at 1/20/2004 9:33:34 PM
I am having problems with the way it save the icon files to gif. all seems to work fine.. but when saving to .gif... I am getting black color background...? any ideas? I am using SHFILEINFO to return the icon handle... from there.. I would like to save as .gif... anyone? pls advise, Nigil ...more >>

System.Drawing & Windows Service
Posted by Michael Leithold at 1/20/2004 2:20:23 PM
Hi there, if I have a windows service running under the system account I have to check the box for desktop interaction. Otherwise I get an error: 'System.Runtime.InteropServices.ExternalException' occurred in system.dll Additional information: Failed to create system events window thread. ...more >>

Bug in printDialog1.ShowDialog()??
Posted by david at 1/19/2004 6:01:07 PM
Everyone I am using .NET Framework 1.1 and MS Development Environment 2003 and Windows X I have noticed that when you display the generic printDialog.ShowDialog method and there are no printers setup on the machine the dialog prompts for the user to add a printer, which is good. The bad part is ...more >>

System.Drawing.Rectangle
Posted by Drew at 1/19/2004 5:16:34 PM
Hi, I'm working in C# here. This seems like it should be an easy one, but I can't seem to get it. How do I change the dimensions of a System.Drawing.Rectangle without creating a new one? I'm very concerned about memory usage and I can't really see why I shouldn't be able to resuse my r...more >>

Optimize the getPixel function...
Posted by sam NO[at]SPAM samdavies.co.uk at 1/19/2004 4:11:58 PM
Hi, I'm currently working on some code that reads the color of a bitmap using the getPixel.Name function. I then use this to determine if the color returned is what i am looking for. The code works fine, but is very slow when workign with large bmp. I have read numerous reports that the get...more >>


DevelopmentNow Blog