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 2005

Filter by week: 1 2 3 4 5

OLE documents in GDI+
Posted by VBen at 1/31/2005 4:19:48 PM
Does anyone knows how (if there's a way) to draw OLE objects (like a Corel Draw! image, or an XL spreadsheet) in GDI or GDI+? I have an app in VB6 that supports insertion of OLE documents into a graphical document (resizing, clipping, etc), and we want to migrate to ..NET, but the only thing tha...more >>

problem with GetFontData function using
Posted by Eugene at 1/31/2005 4:04:17 PM
Dear All, I want to embed font into my application. I use the GetFontData function from GDI. All works fine, except of true-type-collection file. In this case, I get byte array which contains a wrong data. Header is the correct ttf-font. All offsets or lengths in the headers are incorrect. ...more >>

GDI+, Pens and Draw*** methods
Posted by Andreas Håkansson at 1/31/2005 12:36:22 AM
From what I have been able to gather I have understood that because of the nature which GDI+ works, the Draw** methods will always draw 1 more pixel than you had expected. One explination I read for this is because it accounts for the width of the pen, just as it would in real life drawing. ...more >>

What control is being painted?
Posted by Blair Bonnett at 1/29/2005 5:25:52 PM
Hi all, Run into a problem I can't find a solution for. I'm writing a C# app which has a custom background for the form (a gradient). I've successfully overridden the forms OnPaintBackground(PaintEventArgs pevent) method to paint the background. However, it seems that some of the control...more >>

another transparency question
Posted by Martin Williams at 1/29/2005 4:58:20 PM
I used the example on Bob Powell's site to draw a gradient on the background of the parent form in my app (VB.net). Now, I would like to have a logo docked in the corner, but have the background of the logo be the gradient, not the base color of the window. The logo is a gif set with a transpar...more >>

Printing from a Windows Service
Posted by Paul Wardle at 1/28/2005 4:37:58 PM
Hi I am trying to print a document from a Windows Service Eveything works, apart from I can't set the page settings into Landscape! It always prints portrait. If I host my code in a normal app (not a Windows Service) it works OK! Could this be a security issue? I see that Microsoft use ...more >>

copy a portion of a bitmap to another bitmap (via picturebox or other method) ?
Posted by Mad Scientist Jr at 1/28/2005 6:45:10 AM
I have a bitmap (32 pixels high, 8192 pixels wide) that contains 255 images, each 32 pixels wide, that I would like to chop up into individual 32x32 bitmap files. Rather than spending hours in Paint or Photoshop I would like to do this programmatically. My code below attempts to load in the orig...more >>

Obtaining a bitmap image of a TreeView control
Posted by AlBruAn at 1/26/2005 11:45:03 AM
I'm needing a control similar in all aspects to a TreeView control with one major difference. Due to the application in which I need to use the control, I need the vertical scrollbar to be displayed on the left-hand side of the control whenever it is visible. My thought revolves around someh...more >>



Issues rotating an image - Where did my DrawArc() go?
Posted by awbacker NO[at]SPAM gmail.com at 1/25/2005 6:18:33 PM
I am having a funny issue with rotating an image. I am modifying the code that creates a rounded corner image, and it appears that the arc that it draws is getting 'lost' during rotation. I have no problems with the straight lines that I draw, but the arc (when flipping x) gets pushed left 5 p...more >>

GDI+ FAQ: Problem with best-fit transform and JPEG image
Posted by Greg Chapman at 1/24/2005 6:46:20 AM
I compiled and ran the sample code from the GDI+ FAQ found here: http://www.bobpowell.net/bestfit.htm The program worked correctly for GIF and BMP files, but when I tried a JPG, it appeared to translate, but not scale (the height of the image I was using was roughly twice that of the form: o...more >>

generate a serverside gif-image from a textinput
Posted by stinegrith at 1/23/2005 11:23:57 PM
We are generating a serverside gif-image from a textinput. The problem is that we also are trying to draw a border around the text at the image. First we draw the image using Bitmap and graphics, then we use GraphicsPath and Pen to draw the text, which is white with a black border. The...more >>

Finding nearest color of a predefined palette
Posted by Jerad Rose at 1/23/2005 10:38:21 PM
I have a seemingly simple problem that I've been unable to find the solution for. I have 15 sets of predefined palettes, each having 15 colors. All I'm trying to do, is load images (jpg, gif, or bmp) or any size into a 32x32 15-color image. I know how to resize the image to a 32x32 bitmap, b...more >>

Restricted "Paint" Program
Posted by c downey at 1/22/2005 1:18:53 PM
Does anybody know how I would go about building a program where the user could drag and drop clipart onto a form (I know this can be done) but once they are finished, they can save the entire as an image. E.G. The form is going to represent a backyard, and I want to build it so that the us...more >>

Inverse text - with transparency!
Posted by Paul Wardle at 1/21/2005 9:51:23 PM
Is there anyway to draw transparent text on an black rectangle (without using a temporary bitmap) in GDI Plus? This should leave etched out letters in a black area through which I can see the background. Any ideas? Paul Wardle ...more >>

Does anyone know SystemColorTracker
Posted by Sascha Füller at 1/21/2005 9:45:33 PM
Hello everybody, does anybody know what System.Drawing.Internal.SystemColorTracker is doing? The reason I ask this is a strange behavioer I found in my application. I think I can fix the problem, but the behavior of this component (SystemColorTracker) seems really confusing. As I was p...more >>

System.Drawing.Bitmap alpha
Posted by instruo at 1/21/2005 5:59:02 PM
I'm using the System.Drawing.Bitmap class for loading a 32-bit bmp file which includes an alpha channel. The problem is, when it gets loaded (just using the Bitmap(string filename) constructor), it doesn't bother bringing the alpha along with it. All of the pixels just show "255" as their ...more >>

Screen Size and Print Size
Posted by mike at 1/21/2005 2:49:01 PM
Hi, Is there a way to determine the physical size of the client rectangle? i.e. I have a panel i draw to, and I want to know the actual physical size of the rectangle, regardless of the scren resolution. My first attemp was just using e.Graphics.DpiX and e.Graphics.Pixel but after readi...more >>

Image Transparency Lost When Saving
Posted by michael.hofer NO[at]SPAM civigenics.com at 1/20/2005 1:47:37 PM
I've searched through the archives in these newsgroups and throughout Google in general, and everything seems to indicate that .NET 1.1 doesn't support saving transparent images to disk (either BMP, GIF, or JPG). Is this true? If so, any idea on when Microsoft plans to fix that? It's great ...more >>

Color problem with DrawImage
Posted by adospace at 1/20/2005 11:43:40 AM
Hi all, I'm using DrawImage method to draw various kinds of images (bmp, gif & jpeg) into a control paint event handler. I notice that image drawn has different colors from the original saved image. For example if I draw an image with a RGB(192,192,192) background color the resulting image...more >>

Is Anyone In?? Working?? Wakeup!!! Help!!!! FYI, Holidays are over.
Posted by Heino.Jebsen NO[at]SPAM web.de at 1/20/2005 4:01:53 AM
Hello is it possible to change print orientation page by page say Page 1 - Portrait Page 2 - Landscape Page 3 - Portrait Page 4 - Landscape Page 5 - Portrait Page 6 - Landscape Page 7 - Portrait Page 8 - Landscape It is not very clear whether .Net is capable of printing where we...more >>

grnerate a serverside gif-image from a textinput
Posted by stine.grith NO[at]SPAM creuna.dk at 1/20/2005 1:20:13 AM
We are generating a serverside gif-image from a textinput. The problem is that we also are trying to draw a border around the text at the image. First we draw the image using Bitmap and graphics, then we use GraphicsPath and Pen to draw the text, which is white with a black border. The pro...more >>

Serialize error
Posted by Dave at 1/19/2005 12:05:09 PM
I'm trying to add a single bitmap image as part of a serializable class definition. When trying to save the class to a file I get the following error: A generic error occurred in GDI+. The class definition is something like this: <Serializable()> Public Class myClass : Implements IClone...more >>

problems with Paint() event of the control
Posted by marko v via DotNetMonster.com at 1/19/2005 8:50:42 AM
Hi all, I have one frustrating problem. I have class which contains Panel control(using for drawing). Drawing in this control is thru Paint() event. In Paint() event I have Graphics object and I'm doing necessery drawing. Some method of class (drawImage or addImage..) in which I call Panel.Invali...more >>

transparent image on PocketPC
Posted by marko v via DotNetMonster.com at 1/18/2005 11:52:29 AM
Hi, I have a problem with a trancparency on PocketPC. Method Bitmap.MakeTransparent() is work very good on PC but this method is not supported by Compact Framework. I have a simple task. I wanna draw a image above the other image like a layer. Image that I draw like a layer will have one backgro...more >>

Interacting with a complex image
Posted by Scott McChesney at 1/18/2005 9:25:24 AM
Folks - I've been given a project to work with, and I'm having a problem figuring out how to tackle it. I am working with the attached image, which is a chart that has to be filled in with values in specific locations. Those locations are "everywhere" - data, or captions to data, will have...more >>

Rotate EMF for print
Posted by Massimo at 1/18/2005 5:05:06 AM
HI, there is a way to rotate an EMF? RotateFlip doesnt work with EMF. How to copy EMF into a Bitmap and rotate it? Thanks in advance. Best Regards Massimo...more >>

Another Control drawing issue
Posted by Todd Bright at 1/17/2005 2:05:06 PM
Sometimes my UserControl will magically move and resize itself on the form when the app is run from the IDE. It looks like it reverts to the size of the actual control when the the control itself is open in the IDE. And in addition, it slaps it up at 0,0. It looks fine on the running app's ...more >>

Drawing Image and Disposing image from PictureBox
Posted by marko v via DotNetMonster.com at 1/17/2005 9:35:55 AM
Hi everyone, I have two questions if you like to help me a little I'm using PictureBox control on my PocketPC application. I have drawing and displaying in PictureBox. 1. Is it good method to all drawing, cleaning and stuff doing in other place(some other bitmap, graphics..) and then simply...more >>

Double-buffering issue
Posted by Todd Bright at 1/17/2005 7:29:22 AM
I've got a UserControl that I've created and I am handling all painting. I'm using the following line of code: SetStyle( ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true ); The problem is that when I add this line into my control's Load() even...more >>

Printer Margins Compared to PrintDocument Margins
Posted by Ciaran at 1/15/2005 12:20:17 AM
Hello, I am printing a printdocument to a lexmark laser printer. When viewing the document in a preview it looks perfect with 1.5cm borders all round. However the printer adds an extra 1.5 centimeters to the left and top borders. How do you handle this so the preview matches the print out...more >>

Drawing a line with mouse drag?
Posted by John Parrish at 1/14/2005 11:05:41 AM
Can anyone point me to an example of drawing a line in real time as a user drags the mouse. I have tried several ways to get around the flickering caused by invalidate when the line is drug across other elements, to no avail. I have the book on GDI+ with .NET but it does not show an example...more >>

How to draw fast a random shaped controls ?
Posted by Bachus at 1/13/2005 8:50:58 PM
Hi, I have a form on which I want to place elliptic shaped controls. Next I want to move these controls. Everything works fine when there is less than ten controls but when I have a lot of them (about 100) my controls are redrawing very slow. But if i use normal shaped control it works fine. I ...more >>

body chart as image file and need drawing on the image & printout
Posted by Elene at 1/13/2005 8:39:01 PM
Hi, There is an request from my customer to incorporate body chart/diagram in ..net platform so that drawing of different points/icons/symbols can be done on the image to denote something done to the image. After that, all these drawings on the image must be able to printout in report. ...more >>

Bob Powell's "How to use the CreateGraphics method"
Posted by joeycalisay at 1/13/2005 5:28:34 PM
Mr. Powell suggests to use CreateGraphics outside Paint eventhandler, OnPaint, OnPaintBackGround in order to obtain the graphics object. At WndProc method, one can grab a graphics object from the handle of the control's window (GetWindowDC). When I am handling the WM_NCPAINT message, what will...more >>

Problems with GDI+
Posted by John Parrish at 1/13/2005 9:59:56 AM
I’ve been doing some work with the GDI+ aspects of the .NET framework to further my ability to write custom controls. I have noticed some things that are frustrating to me, and I am wondering if maybe someone would be kind enough to explain, or point me in the right direction. First things ...more >>

Prb: Saving graphics to a file
Posted by Amit Gandhi via DotNetMonster.com at 1/13/2005 6:10:31 AM
1) How to save the image in the picture box as a file, in the same format and display as is appearing in the picture box after stretching or centering the image? i.e. the picture box display should be stored as an image file, not the image in its actual format. 2) The graphics generated on the pi...more >>

ComboBox not showing items in dropdown
Posted by John M at 1/12/2005 12:47:06 PM
Has anyone experienced a problem where the items in the dropdown area of a combobox do not appear? I can press the down arrow on the keyboard when the control has focus and the proper text will display. I can even open the dropdown, select any item (that is not drawn) and the proper text is ...more >>

scrolling map
Posted by marko v via DotNetMonster.com at 1/11/2005 9:39:41 PM
Hi everyone, I have a doubt about one thing and it will be very helpfull if someone knows the answet and some gudilines to the solution. I'm developing application for the Pocket Pc. Application need to deal with GPS. On the device, on smart card will be map, about 80MB big. I can use the who...more >>

Partial painting of a control
Posted by Phil Jones at 1/11/2005 3:48:36 PM
I'm a little confused over re-drawing part of a control. From reading the ref docs, it appears that the Invalidate([rect]), that takes a rectangle or region as a parameter should do this. However what I'm finding is that when this method is called with a Rectangle that represents a part of...more >>

large bitmaps for printing (GDI+)
Posted by semhelp at 1/11/2005 7:57:06 AM
I need to draw a bitmap from CAD data and then print it in color (at least 16 bits) at 600DPI to a large page. The resulting bitmap can be as large as 20000 x 20000 pixels. What is the best way to work with these large images? Is there some way to work with them in a compressed format? If ...more >>

How to get PrintPreviewControl Zoom property after resizing?
Posted by John M at 1/11/2005 3:37:01 AM
I've placed a PrintPreviewControl in a MDI child form. It has a Dock property of fill and an AutoZoom property of True so that whenever the form's size changed the control will change as well. On a status bar I've added an area that shows the Zoom property. Unfortunately I can't get the cor...more >>

.NET GDI+ Training Needed
Posted by Robbe Morris at 1/10/2005 8:14:47 PM
Can anyone recommend a trainer/training course that deals solely with GDI+ and goes far and above the typical "here is how you draw a circle" scenarios? We are started to get rather complex imaging requirements and my GDI+ knowledge is at a very basic level. I need access to an expert trainer...more >>

Graphics.GetHdc/Graphics.FromImage/R2_MASKPEN Woos
Posted by gdi_plus NO[at]SPAM yahoo.com at 1/10/2005 3:11:00 PM
Hello all, I'm trying to draw a rectangle with ROP2 = R2_MASKPEN on a GDI+ image. The method below (TestDraw) works when I pass it a Graphics object from a paint event. However, when I pass in the result from Graphics.FromImage, it seems the ROP2 is ignored and I end up with a solid black re...more >>

GUI for tabletop interaction. Is it possible?
Posted by Daniel Tomasini (ITC - Italy) at 1/10/2005 8:21:03 AM
I’ve implemented a GUI for a tabletop device using C# and the .NET framework 1.1. At the moment, my interface consists of a collection of virtual sheets of paper in which you can draw. Those documents can be rotated and moved. For the first prototype, I implemented all the graphics by myself...more >>

Office2003 Colors
Posted by Johannes Hofmann at 1/8/2005 2:24:45 PM
Hi, where can I find the colors, that (3rd party) controls use, when they are in Office2003 design-mode. Somehow these colors depend on the XP-style and must be available in the system. Where can I find those colors? Anybody knows? ...more >>

Modify jpg but leave quality the same
Posted by shelby_marsden NO[at]SPAM hotmail.com at 1/8/2005 10:31:46 AM
Is it possible to write a program that will modify a jpg, say adding some lines or text to it, and then save it leaving quality and compression the same? Ideally in such a way that you could run the program multiple times with no degradation in quality? I know that there are some transforms (lik...more >>

Displaying GrayScale Images
Posted by Rick at 1/8/2005 6:01:02 AM
I am converting an Win32 medical image processing application to .Net. I am new the UI side of .Net applications and I am trying to display a grayscale images at a reasonable frame rate (5-10 frames per second). The application captures 1024x768 12-bit grayscale pixels, which I am storing in ...more >>

problems with flips/rotations of certain shapes
Posted by sean.slavin NO[at]SPAM wonderware.com at 1/7/2005 2:46:46 PM
I'm trying to debug some code and now I'm lost. Here's the problem. I have a graphic editor with which I can draw shapes and other graphical items. I can also do rotations (90 degree increments, clockwise and counterclockwise) and flips (horizontal and vertical). With some shapes, such as a cu...more >>

how do I save/convert a bitmap to a gif,jpg,png or xmb to display
Posted by Matt McGinnis at 1/7/2005 12:31:09 PM
I found an article on how to save an image to a bitmap file but I want my output file to be viewable in Pocket IE and .bmp is not supported. Does anyone know where to find the code or a library that will allow me to save directly to , or convert to one of the file types compatible with Pocke...more >>

font border
Posted by nik NO[at]SPAM email.dk at 1/7/2005 6:46:00 AM
I would like to use the method DrawString(string,font,brush,x,y) to draw a string. The string should be drawn with a certain font and should also have a two pixel border around each letter. My idea so far is to draw the string twice first in a large size and then again in another color and a bit...more >>


DevelopmentNow Blog