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 2005

Filter by week: 1 2 3 4 5

Resizing and Printing .tif Image Files using C#
Posted by brettk NO[at]SPAM gmail.com at 6/29/2005 2:07:37 PM
Hello All, I'm writing a small application that watches a directory for .tif image files. When one arrives in the directory, my application needs to resize it so it prints out on a letter-size page. If I print them the way they arrive, the top corner of the image is printed (and it spans th...more >>


best approach for scrolling through set of images...
Posted by bcallister at 6/29/2005 1:15:04 PM
hello- i am creating a .NET C#/WinForms application that needs to allow the user to scroll *flawlessly* through a set of between 50-150 JPG images (of size ~30-80K per image), via a standard scrollbar. i have implemented this solution already, using a single PictureBox for display. the i...more >>

Form Scrolling
Posted by Andrew at 6/28/2005 9:18:01 PM
I have noticed that the scroll state of the form has an effect upon the results of executing the Update() function. Refering the the Microsoft SDK notes, the Upate() method " Causes the control to redraw the invalidated regions within its client area." In the OnMouseDown of one of my forms...more >>

You may not change this Brush because it does not belong to you
Posted by Nilesh at 6/28/2005 8:05:13 AM
Hi, I got the following exception in the code. "You may not change this Brush because it does not belong to you". because of this i am getting my control with big red cross "X". can any one help me in this? Thanks & regards Nilesh...more >>

SetBkMode in .Net?
Posted by James Minns at 6/28/2005 12:00:00 AM
Hi all, I'm trying to paint some text onto a graphics object with the DrawString function. I can't accomplish what I used to do with the GDI function SetBkMode, which allowed me to write transparent or opaque text on the HDC. Now, all text is transparent. How can I get the DrawString funct...more >>

Drawing of PNGs with transparent pixels
Posted by Alexander Groß at 6/27/2005 10:47:52 AM
Hi everyone, I have a problem I'm currently stuck with. To enable icons in menus, I've written my own drawing routine for MenuItems (OwnerDraw=true). The icons to be displayed are PNGs with tranparency and are an embedded resource. On startup I load the images into an ImageList as described...more >>

links to help using a window handle to print graphics to
Posted by Flip at 6/24/2005 1:59:21 PM
Hello, I'm new to C#/.NET and would like to play around with the preview window for a C# screen saver. I understand from a previous posting I did that one of the parameters given to a screen saver is the window handle for the preview pane (correct term?). Ok, I understand that in english, bu...more >>

Two newbie questions
Posted by zhaounknown at 6/24/2005 12:28:04 AM
1. PaintEventArgs.Graphics.Drawstring() need to specify the upper-left coordinate for the text to be drawn. What measure unit should be used for the coordinate? 2. Why the following piece of code can't print the Texts (on letter paper)? However, if remove the "e.Graphics.PageUnit=GraphicsU...more >>



GDI / GDI+ Hardware Acceleration Status
Posted by Steve at 6/24/2005 12:00:00 AM
Hi I am new to GDI programming and Win32 programming in general and I am trying to get some definitive understanding on the state of hardware acceleration (and general software optimisation come to that) in GDI and GDI+. I am hoping to use either GDI or GDI+ for some 2D animations I would ...more >>

MeasureString doesn't work with spaces.
Posted by Neil Walters at 6/23/2005 5:41:18 AM
If a string contains spaces MeasureString returns unexpected results The following code private void button1_Click(object sender, System.EventArgs e) { using (Graphics g = this.CreateGraphics()) { string s = "s"; for (int i = 0; i < 40; i++) { SizeF size = g.Meas...more >>

DrawImage and Out Of Memory
Posted by Peter Laurinc at 6/23/2005 12:00:00 AM
Hi, I have problem with drawing large bitmaps. There is firstBitmap 32bppARGB for offscreen drawing sized cca 1000x700 pixels. From file I load secondBitmap 1bppIndexed sized ccz 9000x14000. I want to draw second bitmap scaled to first bitmap. I get graphics from firstBitmap and set it...more >>

How to scale Image/Bitmap
Posted by yogee at 6/22/2005 10:50:02 PM
Hi, I have bitmap object of size AxB. Now I want to scale to 80%. Here by scalling I mean Strech or shrink the image. I am not able to see any functionality available in Bitmap/Image object. Please help me in finding the direct way to do it. Language : VB.net ..net Framework : 1.1 Tha...more >>

How to print to a fixed point
Posted by zhaounknown at 6/22/2005 10:07:01 PM
How can I print a String into a fixed point in a Letter page, say, 1.32inch to the left edge of the paper, and 2.54inch from top edge. Could anyone give a simple sample code for this? New to printing, and thanks xo much....more >>

Help with creating an outline area
Posted by citytroop NO[at]SPAM yahoo.com at 6/22/2005 4:05:43 PM
Hi I am creating a form for vieweing and editing faxes. I read the fax tiff file into the picturebox. And I have two problems: 1.I want to add a function for the users to be able to select an area in the picture box and clear it. I am using the Graphics.DrawRectangle method but the rectangle...more >>

ClipRectangle
Posted by Andrew at 6/22/2005 12:41:01 AM
Hi Bob, Prior to the drawing of any graphical object, I test to determine if that object 's envelope/bounds intersects with the ClipRectangle (c). c is retrieved directly from the base classes PaintEventArgs cliprectangle. I have noticed that when the form is not scrolled, 'c' is OK(sens...more >>

Redraw problem - please help
Posted by Publicjoe at 6/21/2005 11:27:42 AM
Hi all, I am creating a tetris clone, but I have a problem, when I change apps and then go back to it. Any blocks sitting at the bottom of the screen do not get redrawn until the timer goes off, It is best to run the app in order to see the problem, I am enclosing all of the code in order to b...more >>

rectangle Intersects
Posted by Josh at 6/21/2005 12:00:00 AM
Does anyone have an opinion on the speed of the rectangle Interects? My implementation of Pong which uses this method for collision detection seems to suggest to relatively slow. ...more >>

I think I know why setstyle double buffering cases invalidOperationExceptions!
Posted by Garry Freemyer at 6/20/2005 12:22:45 AM
Here is some of the points and observations about my screensaver, where I am being tortured by the InvalidOperationException raised from System.Graphics.EndContainer(). Here is what I think is happening. Does the stack trace below bear this out? Is there a method to tell the control when to ...more >>

Please reply this asap---2
Posted by Pankaj Jain at 6/20/2005 12:00:00 AM
I am using .bmp files as icon in the icon directory -- _________________________________________ Nagarro Software Pvt. Ltd. 3 Type B, Electronics City, Sector 18, Gurgaon, India - 122015 http://www.nagarro.com Phone (+ 91) 124 - 5016775, 2455301, 2455302, 2455303 Extn. 205 Fax (+ 91) 124...more >>

Repaint form?
Posted by Michael at 6/19/2005 4:27:01 PM
Hi! I'm currently working on an editor form my 2D game engine which uses polygons for collions detection. From the main form the user chose to create a collision polygon and then an other form is show. This form is derived from System.Windows.Forms.Form. Each time the user presses a mouse but...more >>

Using Bitmap class GetPixel and SetPixel in Format8bppIndexed pixel format
Posted by Steve at 6/19/2005 12:00:00 AM
Hi I am new to MSVS.NET and GDI and I am attempting to create a VC++ .NET Windows Forms App that will produce and display a bitmap. Using the default pixel format was pretty straightforward but really I would like the bitmap in colour indexed format for image processing use and would lik...more >>

Offering $100 to the first person to fix this issue.
Posted by Garry Freemyer at 6/18/2005 12:02:29 PM
I've got an error on my program posted here. I can't fix it, I can't catch it properly, I can't stop it, I can't recover from it, I can't stand it anymore!!! $100 to the first person to reply in the forum below my article post, with a solution that satisfies the criteria at the end of my a ...more >>

rotating and multi page tiff
Posted by Rachel Suddeth at 6/17/2005 12:27:22 PM
I have a tiff image that I draw like this: private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { // handle null image, background painting e.Graphics.DrawImage(bmpDoc,recDest,recSrc,GraphicsUnit.Pixel); } I have a method to change tiff pages which seems...more >>

How to start a borderless printing
Posted by zhaounknown at 6/17/2005 9:46:10 AM
I tried the following example in two machines and printers. I set the DefaultPageSettings.Margins to have four magins to 0. It turns out that the Left margin doesn't take effect. The source code can be downloaded from http://www.c-sharpcorner.com/Code/2003/Jan/TaxForm.asp (the source code t...more >>

How to print in full page without margins
Posted by zhaounknown at 6/17/2005 9:25:06 AM
I set the DefaultPageSettings.Margins.Left/Right/Top/Bottom to 0, it doesn't seem to work for the Left margin for two printers (HP and Brother). Am I missing any other properties that should be set? Thanks a lot....more >>

Making progress on scrolling?
Posted by Steve Magoon at 6/16/2005 7:39:07 PM
Hi, I would like to scroll an object on a panel with a fixed grid for the background. I couldn't figure out how to use the AutoScroll feature of the Panel tool to do this. My latest approach is to use a horizontal scroll bar docked on the panel, using its scrolling event to invalidate the p...more >>

icons in dialogs
Posted by klumsy NO[at]SPAM xtra.co.nz at 6/15/2005 3:10:37 PM
with messagebox there are various MessageBoxIcon images.. i'm making my own message dialog but would like access to these same images.. how can i access them from my code, then put them in a PictureBox on my form? ...more >>

DrawRectangle problem
Posted by Siri Krishna at 6/15/2005 10:21:43 AM
Hi, We have a custom control into which we add controls like labels and move them at run time. The problem we have is that when a child control is selected and moved, we draw a rectangle around it to identify it as selected. The DrawRectangle works fine when the child controls is on left ha...more >>

How do I turn off write combining programatically?
Posted by Garry Freemyer at 6/14/2005 3:56:24 PM
Using C# Visual Studio Net 2003, my screensaver comes up with this amityvillehorrorInvalidOperationException error "Object in use elsewhere", and I can't fix it! I read that a work around is to go to Display Properties/Settings/Advanced/Troubleshooting and change the settings there and it...more >>

Get Image properties without loading all the file
Posted by pierrev at 6/14/2005 7:51:04 AM
Hi, I want to get image properties (height, width, compression, etc) from TIFF files without creating/loading the whole image in a GDI+ Bitmap object. I have very large TIFF files and I don't want to load all the image only the properties. I was doing that before with the Activex ImgAdm...more >>

Moving a graphic on a picturebox
Posted by cmac89 at 6/14/2005 5:12:18 AM
I'm using the following code to draw a rectangle on a form and then move it to a new position by clicking the mouse. I would now like to do the same thing but within a picturebox. I've added the picturebox but the rectangle stops at the edge of the picturebox. I can't figure out how to change ...more >>

Have data to fill a triangular matrix, but how do I graph it???? - Please help
Posted by Nevets Steprock at 6/13/2005 12:00:00 AM
I'm writing a web program where one of the sections is supposed to output a correlation matrix. The typical correlation matrix looks like this: ..23 ..34 .54 ..76 .44 .28 ..02 .77 .80 .99 I've written code to calculate the correlation data and it is populated in a vect...more >>

how does scrollable controll works?
Posted by SharpCoderMP at 6/12/2005 10:45:14 AM
i'm writing a controll that displays list of thumbnail images. this thumbnails are generated from bitmap files. now let's assume that we have 100 images. inside the controll only 5 will fit. ok i applay sclroll bars and all works great. offcourse after i read files i store thumbnails in memor...more >>

Finally got my C# GDI+ Screensaver working multiple monitors!
Posted by Garry Freemyer at 6/11/2005 10:33:48 PM
It was quite a few weeks ago, when I related that I had written a screensaver in VS Net 2003 C# that was supposed to work on multiple monitors. I had issues with the primary display always hogging CPU cycles. Source is on codeproject.com in the url below. Turns out the fix was mainly these...more >>

DrawTrackerRect?
Posted by porko at 6/11/2005 6:29:01 PM
Anyone know of any code samples that show how to execute a tracking rectangle like DrawTrackerRect() in MFC used to do? I don't see any equivalent functionality in .NET, without rolling your own. ...more >>

Maximum Bitmap Size?
Posted by mike at 6/10/2005 8:11:03 AM
Hi, I am trying to create a bitmap using the (int,int) constructor. I am getting an invalid parameter exception when I pass in the following values Bitmap bm = new Bitmap(4050,40750); Is there a maximum size limit I am hitting when I try this? Thanks Jay...more >>

change part of bitmap
Posted by is_vlb50 NO[at]SPAM hotmail.com at 6/9/2005 12:35:18 AM
How to do next part in dot net: copy out the part of the bitmap within the rectangle, convert it to grayscale, and then copy it back. Thanks ...more >>

PrintDocument lines per page calculation
Posted by AMercer at 6/8/2005 2:33:09 PM
At the end of this note is a VB .NET sample of printing a text file. MS provided it in .NET help. It shows how to print lines of text all in the same font. The PrintPage event handler calculates the number of lines of text that can be printed as follows: linesPerPage = e.MarginBounds.He...more >>

getting around DrawImageUnscaled problem
Posted by Rachel Suddeth at 6/8/2005 11:33:22 AM
Earlier I had an issue where I tried to use DrawImageUnscaled, but it didn't work because apparently .NET does not understand the resolution of my images. So I got around this by always calling DrawImage with Source and Destination rectangles, and specifiying GraphicsUnit.Pixel. Now I've got a...more >>

make image transparent
Posted by jeff at 6/8/2005 8:50:33 AM
hi, All I have a control with a pic(gif), I want to make the pic is transparent. How to do it? Thanks ...more >>

Next Version of GDI+ (maybe GDI+ 2.0)
Posted by Benny at 6/8/2005 3:41:24 AM
Hello, does somebody know something new about the release of next Version of GDI+? My last hope was with the release of Visual Studio 2005 and .NET 2.0, but my testings yesterday with the Beta 2 showed the same slowness as before. Big mono TIF drawings with a size of more than 10.000x10.00...more >>

Freeimage
Posted by James Westgate at 6/8/2005 12:00:00 AM
Has anyone tried using this lib from .NET / c# and if so any impressions good or bad? http://freeimage.sourceforge.net/ Thanks, James ...more >>

Printer.hdc
Posted by S.Malathi at 6/7/2005 8:48:37 PM
How can I get the printer handle similar to VB6 Printer.hdc? TIA. S.Malathi --- Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/...more >>

Color and RGB convertor
Posted by jeff at 6/7/2005 3:29:33 PM
hi, all I have a problem about color change I have int color like 0xFF3300; I want to set control backcolor, but control color just know Color, How to convert it to Color? by the way I use compactFramework thanks ...more >>

screen capture
Posted by is_vlb50 NO[at]SPAM hotmail.com at 6/7/2005 9:39:08 AM
I need to make screen capture by selecting rectangle on desktop.I solved it by copy all desktop to my picture control and make grab on it.Is exist code sample to do it by mouse hook and grab directly from desktop ? ...more >>

GDI ASP.NET C# Flowchart
Posted by Ilife at 6/7/2005 1:41:06 AM
Hi, I am building a dynamic flowchart application in ASP .NET. So far I have objects like Process, Decision, Document and arrows which connect those objects. My only problem is to display the objects like a tree. I have searched a lot, but I can not find a way to do this. Is there anybody who ca...more >>

Calling Paint
Posted by Josh at 6/7/2005 12:00:00 AM
I have a usercontrol with a timer on it. When the timer fires I want to call the user controls paint event. Anyone know how I can do that? ...more >>

how to draw image of jumbled/distorted alphanumerics to defeat page robots
Posted by Timo at 6/6/2005 2:45:13 PM
Is there a .NET control that produces images of jumbled or distorted alphanumerics-- the kind that are intended to make sure robots are not using a page? The user has to read the jumbled text and input it. Thanks Timo ...more >>

DPI of screen different than DPI of printer and specs are in inche
Posted by BYY at 6/6/2005 2:44:03 PM
If anyone can shed some light, then please do so as I cannot understand why this works when it seems like it shouldn't. In a form’s OnPaint method, the pixel width and height of an object is set based on the specifications in inches. widthInPixels = widthInInches * graphicsObject.DpiX; ...more >>

creating fonts
Posted by Phil Da Lick! at 6/6/2005 12:00:00 AM
Hi, I'm looking at the constructor for Font. There doesn't seem to be a way to specify the width of a font as well as the height when creating a font. What gives? This was standard in win32 gdi apps. Am I overlooking something?...more >>


DevelopmentNow Blog