Groups | Blog | Home


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

Filter by week: 1 2 3 4

Get an error tring to using EncoderValue.CompressionCCITT3 in c#
Posted by mitchellguzman at 2/28/2005 12:49:04 PM
The error message is "Invalid parameter used.", but when I change it to ..CompressionLZW it works. All the examples that I found were written in VB.NET and they look simular to my function below. private bool SaveTIFF(ref string outputFile, ref Bitmap bmp, bool bAdd) { try { System.D...more >>


A generic error occurred in GDI+
Posted by TA at 2/28/2005 11:11:17 AM
Hi, I'm testing an app in a virtual pc (Win 98 SE, framework 1.1 SP1), an i'm getting "a generic error occurred in gdi+" in screens where there's a groupbox or a datagrid. if i remove then, it works fine. The error messages are bellow. Is this a "real" error or is happening just because it'...more >>

how can I Get Rectangle from DrawString like DrawTextEx
Posted by Frank Wu via DotNetMonster.com at 2/28/2005 11:10:36 AM
Hi,My friends, i am a boy from china, i meet a problom in my program.i use this code to write a word on form. how can i get the word's size? i know the API function named DrawTextEx can get it because the Rectangle parameter is [in] /[out]. private void Form1_Paint(object sender, Syste...more >>

Resizing uploaded image via GetThumbnail.. Help!
Posted by sitexcite NO[at]SPAM hotmail.com at 2/27/2005 1:50:19 PM
Drawing Gurus.. Ok, I am really new to System.Drawing and I have a web app that lets users upload images (gif, bmp, jpg). If the image is greater than say 75px by 75px, I want to resize it down to that size BEFORE I save it to the database. I have been pointed in the GetThumbNail direction ...more >>

scroll only a portion of a control (csharp)
Posted by billy at 2/27/2005 10:58:56 AM
I need a control that I can draw on. I want it to have a ruler on the top and on the left which I will also draw, but when I scroll the view horizontally for example, I want only the top ruler to scroll along with the view. When I scroll vertically, I want the horizontal ruler across the top to ...more >>

BackColor
Posted by Alessandro mostarda at 2/26/2005 11:35:02 AM
hello I'm creating a set of custom controls but i have a problem. My controls have a property called MOUSECOLOR that depends from backcolor property. When i add a control in the form My Mousecolor property must be clearly of backcolor property.(CONTOLPAINT:LIGHTLIGHT(mybase.backcolor)) I ha...more >>

Get mouse coordinates of image in picturebox
Posted by Tom at 2/25/2005 4:09:18 PM
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and display (in the status bar) the image coordinates of the mouse location. However, if I use the pic...more >>

problem with drawing images with alpha channel
Posted by CzD at 2/24/2005 7:13:03 PM
Hi, I'm writing an owner-draw listbox and want to have some images in it. So, I load png files into image list and now: when I try to draw them 'normaly' (without double-buffering) everything is ok, but when I create an offscreen bitmap and draw my images on it I get black pixels inste...more >>



background image performance killer
Posted by Keith at 2/24/2005 7:28:32 AM
Hi, I'm running into a problem when I place a transparent control onto a form with a background image. The control is a marquee, so the client rectangle gets updated 50-100 times per second. The problem I'm running into is that when the background image is large, the CPU is running at 100%....more >>

Direct memory-access GetPixel()-method returns 0 instead of 255
Posted by Morten Nielsen at 2/23/2005 2:21:00 PM
Does anyone have any idea why I can't get a pixel-value of 255 returned in the code below? Any color-value from 0 up to 254 is returned correctly, but any color-component of 255 returns zero. ie. bright white pixel would return 0,0,0 with the function below: The color (234,123,255) returns (2...more >>

Drawing a single pixel
Posted by Rob T at 2/23/2005 9:50:10 AM
This seems like a really stupid question, but here it goes........ is there a command to draw a single pixel? The closest I can get is to draw a line that is 2 pixels wide, or do create another image that's 1x1 with the color of the pixel, then do a DrawImage to insert that image into the ...more >>

opening tiff - out of memory exception
Posted by Norvin Laudon at 2/23/2005 8:59:02 AM
Hi, I have an 8bpp greyscale tiff file (created using a C++ library call tiflib) that causes out of memory exceptions when opened using Image.FromFile in GDI+. I can open it with other programs like Irfanview and Imaging. If I save it as a 24bpp using one of these programs, GDI+ will open i...more >>

No encoder parameters for PNG encoder?
Posted by antao NO[at]SPAM iilab.com at 2/23/2005 8:00:16 AM
I'd like to save PNG using 16 bits, instead of the default 24 bits. It looks like it's not possible... The following page on GDI+ shows that the PNG encoder accepts no parameters: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/usingGDIPlus/usingimageencodersand...more >>

Calling all MVPs and GDI+ gurus...
Posted by Philipp Schumann at 2/22/2005 8:27:54 PM
OK, my previous message news:uIukmiPGFHA.1932@TK2MSFTNGP14.phx.gbl was probably a bit too long... (subject: "[Bug Suspicion] So, <any_gdi_object>.Dispose() does ... what exactly?", sent a few hours ago) So here is, in a more compact form, my problem: I create Icon objects out of owner-draw...more >>

How do I view and edit the alpha channel of a bitmap
Posted by Teis Draiby at 2/22/2005 6:15:55 PM
- Is there a way to have a greyscale view of a Bitmap alpha channel, just like the alpha channel palette in Photoshop. - Like in Photoshop, is it possible to draw in an alpha channel using greyscale values of the Brush, leaving the alpha values of the Brush for blending brush fills with the or...more >>

[Bug Suspicion] So, <any_gdi_object>.Dispose() does ... what exactly?
Posted by Philipp Schumann at 2/22/2005 4:07:43 PM
Hi, I have developed a very small Windows application which creates a new Icon using .NET GDI+ every second (or every minute, that's user-definable). I need to do this because my "drawing surface" is a system tray icon so I can't just paint to a control or something. However, whenever I rep...more >>

DrawString size?
Posted by Rob T at 2/22/2005 2:30:01 PM
Is there a way to determine what the size of a GDI+ string output would be prior to drawing? For example, If I have something like this: Dim fnt As New Font("Times", 12) Dim drawFormat As New StringFormat drawFormat.LineAlignment = StringAlignment.Center drawFormat.Alignment = StringAlignme...more >>

Save tiff with multiple pages
Posted by Mogens Nielsen - Elbek & Vejrup A/S at 2/22/2005 11:29:03 AM
Hi newsgroup, I am developing an application which has to save an tiff-image, which in turn can have multiple pages. When using the following code, however, only the first page of the tiff-file gets saved: public void SaveImage(byte[] b, string filename) { System.Drawing.Bitmap image = ne...more >>

UserControl Issue
Posted by Todd Bright at 2/22/2005 8:11:06 AM
I've got a WIndows Forms usercontrol that I'm drawing myself. I needed scroll bars so I've put them on the control at design time and am showing and hiding them when needed. My problem is that when I mouse over one part of the control I change the cursor to an IBeam and when I then enter a s...more >>

How to draw vertical scolling text
Posted by tesis at 2/20/2005 4:10:42 AM
Hi all gurus, pls can anyone tell me how2 achieve a "Star wars" effect? Or better, do you know some component for me to help? TIA *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

OwnerDraw problem - bug?
Posted by mosimu at 2/20/2005 1:03:02 AM
My MenuItems are set up to be owner drawn. Everything is working perfectly fine for me but when I have a MenuItem that has its own child menu, Windows draws the submenu-indicating-arrow anyways. Surely this is not intentional? Doesn't owner draw mean I do all the drawing? Sample project ...more >>

Adding Click event to owner drawns shapes
Posted by Tushar at 2/19/2005 6:55:02 AM
hiii i have made a class MyObject. It has a draw function. I am able to draw all the objects on the form. I am able to save them to a file and read them also. Now the problem is that i want that if a user clicks on any of the object something should happen. i have tried a lot but failed. pls...more >>

GDI - Drawing a rectangle to the upper-right of an image NOT the upper-left, How To?
Posted by hack123 NO[at]SPAM hotmail.com at 2/19/2005 4:53:07 AM
G'Day all, Ok so I can draw a rectange (with borders and fill whatever) to the upper left of an image easily, but I cant work out how to draw the rectange to the upper right of an image? Keeping in mind that the image will change size so there has to be another way to this without using x/y c...more >>

Reversing text in TreeView nodes
Posted by Allen Anderson at 2/18/2005 7:29:13 AM
I haven't received an answer to my question of a few days ago regarding a flipped treeview control posted in the dotnet.framework.windowsforms.control newsgroup, so I thought I'd ask it again. Sorry about the cross-posting, but I'm getting desperate as the drop-dead date, the 25th of this mon...more >>

vb.net
Posted by shivaprakash.s at 2/18/2005 4:41:01 AM
How i can retrive data from spreadsheet and draw an chart using office 2003 in vb.net?please its very urgent From http://www.developmentnow.com/g/20_2005_1_0_0_0/dotnet_framework_drawing.htm Posted via DevelopmentNow Groups www.developmentnow.com/g www.developmentnow.com...more >>

How to rotate text that contains multiple fonts/colors/sizes in C#
Posted by Chad Scholes at 2/17/2005 10:47:06 PM
I need to rotate text that may have multiple lines and contain multiple fonts. The best thing I could think of was to rotate a RichTextBox but I can't seem to do that. I could draw the text using GDI+ but all the examples I have seen only use one font. Seems that it may be difficult to calculate w...more >>

drag rectangle over controls
Posted by Keith at 2/17/2005 12:11:34 PM
Hi, I am trying to drag a rectangle throughout a form for a graphical design application. The problem is that when I implement DrawRectangle or ControlPaint.DrawBorder, the rectangle is obscured by other controls as it passes over them. The only solution I can think of is to intercept OnPa...more >>

RotateFlipType Enumeration
Posted by Jaime Camargo at 2/17/2005 8:05:07 AM
Hello, I am trying to "add" these enumerations in a way that would allow me to figure out what the desired rotation is. For example, if a user chose to rotate an image 90 degrees and flip about the X-axis then ideally I would do something like: RotateFlipType rotDesired = RotateFlipType.R...more >>

Getting images into byte arrays
Posted by RichardF at 2/16/2005 5:08:26 PM
Can anyone tell me what is wrong with this code? I want to get the ocntents of the JPEG image into a byte array. After the theStream.read call, the theBytes array is still filled with all nulls. and iCount is zero. I used this article (http://msdn.microsoft.com/library/default.asp?url=/lib...more >>

I hate gdiplus DrawString.
Posted by Giedrius at 2/16/2005 3:40:37 PM
The most ugly feature (actually until now the only ugly feature) of gdiplus is vissible then creating custom drawn grid. Why in a hell the same text is drawn using different spacing. I know about antialias (ugly at smaller font sizes), ClearType (ClearType on my notebook sometimes helps if I...more >>

System.Drawing.Icon and hIcon (ptr to an ICONIMAGE structure)
Posted by WALDO at 2/16/2005 12:44:06 PM
I have an interesting quandary. I have developed a program in VB.Net to extract an icon resource from an exe/dll or from an ico file and enumerate its formats (16x16,256 color;32x32,true color;etc.). It reads out the structures all the way down to the ICONIMAGE structures. I have this represen...more >>

Memory Images Lost on Form Visibility Change
Posted by Extreme Datasets at 2/16/2005 12:39:03 AM
Hello I have a Windows Form in which i am loading 2 images at run-time. I draw some text on the images, set the background picture of the pictureboxes to the images Everything fine. If i hide the form and show the form the images (hosted in the pictureboxes located on a panel) do not ...more >>

jpeg2000
Posted by St at 2/15/2005 1:16:05 PM
Hello, do you know how generate picture in jpeg2000 format ? I am searching for a free library, but is it possible ? Thanks ...more >>

Microsoft: Help with OLE documents...
Posted by VBen at 2/15/2005 11:35:30 AM
Hi all. I have an application to draw and design different documents, that supports linking and embedding of other documents (like, for instance, Corel Draw or Word). Then, the user can print their designs "WYSIWYG", so I load the external document inside an OLE document container control (VB6),...more >>

Basic 3D Drawing
Posted by Marcus de Leon at 2/15/2005 11:33:35 AM
Hi, I was wondering what is the best way to implement a 3D view of a simple grid of lines using basic GDI+ and C#. The grid is supposed to represent land and I will place objects on the grid. I will need to be able to change perspective views of the grid. Any help would be appreciated. ...more >>

MesaureString etc.
Posted by elziko at 2/15/2005 11:29:48 AM
I am trying to use DrawString to draw a string that contains normal and superscript text. To do this I have to use DrawString several times changing the font size and position for the superscript part. This works apart from the spacing. I use MeasureString on the previous string to work out...more >>

Not-Installed-fonts question
Posted by Picho at 2/14/2005 9:30:23 PM
Hi guys. is it possible to embed a font (which is probably not installed on the client machine and I dont want it to be) in the assembly (the font file itself or anything else) and then use that embedded resource for creating System.Drawing.Font objects? Thanx, Picho ...more >>

ColorTranslator.FromHTML not working with Color Name
Posted by Jason Follas at 2/14/2005 12:35:18 PM
If I use ColorTranslator.FromHTML("#ff0000"), I get Color.Red returned. However, if I use ColorTranslator.FromHTML("Red"), I get RGB=0x0 returned (silent failure). The documentation suggests that HTML color names should be valid inputs, and I swear that I've used this in the past. Has thi...more >>

jaggie fonts on server, but not on local host
Posted by Michael Bodily at 2/14/2005 11:45:16 AM
Hi all, I have written an Ecard application which takes text input from the user on one .aspx page and renders the message to a template .jpg and displays the results on a 2nd .aspx page. The trouble is that my fonts render fine on my local host machine but very jaggie on the server. IIS 5.1 ...more >>

DrawRectangle and ScaleTransform
Posted by Cristian Pascut at 2/13/2005 5:02:04 PM
Hi, I have the following code: Protected Overrides Sub OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs) MyBase.OnPaint(pe) 'Add your custom paint code here Dim g As Graphics = pe.Graphics g.FillRectangle(Brushes.White, Me.ClientRectangle) g.ScaleTransform(m_nZoomFactor, ...more >>

Drawing
Posted by KDV at 2/11/2005 9:31:08 AM
I have rectangle and circle which intersect on the drawing surface. I want to fill in the intersecting region. How to calculate the intersecting region the best way? Thanks in advance KDV...more >>

Very Large Bitmaps
Posted by emars NO[at]SPAM forwild.umass.edu at 2/10/2005 12:23:55 PM
Greetings, I am working with large bitmaps of 13,000x18,000 pixels and need to do some cropping at minimum. The code I use is fine for smaller bitmaps but does not work for the large size bitmap, and gives an invalid parameter error on the creation of the new Bitmap(**). The code works fine ...more >>

How to get the mouse wheel event ?
Posted by Gilles Lambert at 2/10/2005 6:12:23 AM
Hi, How to get the mouse wheel event in a WinForm control ? Thanks Best regards *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!...more >>

redrawing graphics
Posted by Chris at 2/10/2005 5:25:03 AM
I'm currently drawing in a panel a series of polygons which get their points from an Array. I've created a button which deletes the data for one of the polygons from the array, and then calls the panels Invalidate method. However this clears the panel, and doesnt redraw any of the other polygo...more >>

Printing RichTextBoxEx
Posted by Páll Ólafsson at 2/9/2005 3:07:04 PM
Hi gurus... Houston we have a problem? Im printing out the contents out a RichTextBoxEx and it works great. Its fast and it does everything I want it to do BUT when I'm finished printing out the content I want to get the position ( Point) where the function FormatRange but the last char. I...more >>

Tiled Images
Posted by Jake at 2/9/2005 2:31:04 PM
Not quite sure how to ask this. I'm new to graphics programming. I'm trying to figure out how to only open part of an image. I have an image with about 4 or 5 tiles. Each tile is 32x32px. I want to load this 'tile set' into an array so that I can use it in my program. This way I don't have to ...more >>

Editor Suggestions
Posted by Rob T at 2/9/2005 12:06:30 PM
I need to write a 'simple' editor that will allow me to drag/drop different objects. Basically, I need it to function like a form editor similar how you would design a form in Visual Studio or Access, or work how Adobe Illustrator works where you can have handle(s) on the selected object so it ...more >>

Make TIF files open using .NET program
Posted by Becker at 2/8/2005 2:30:08 PM
I would like to programatically on install set TIF files to open with my ..NET program. I have heard this is hard to do. Does anyone have any examples of this? Thanks, Becker ...more >>

Convert to 1 bit black / white
Posted by Becker at 2/8/2005 11:02:13 AM
I have a TIFF that is CCITT4, i open it in my program, stamp some text on it (thanks Bob Powell for the GDI FAQ which helped on this). I load my image into a bitmap for my editing. I now need to save it and I am trying to do this specifying the encoder parms for compression to make it CCIT...more >>

Drawing vector graphics?
Posted by Yaron at 2/7/2005 2:01:01 PM
Hi, Is it possible to draw onto a graphics object a vector? I'm asking because I have artwork created in Adobe Illustrator which I would like to save and draw in .NET. I've tried saving it as a BMP but it still comes out very pixelized when I draw it. What about WMF files which Microsof...more >>


DevelopmentNow Blog