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 > november 2006

Filter by week: 1 2 3 4 5

Bitmap Strip and Animation
Posted by Craig at 11/27/2006 4:25:06 AM
Hi I have a bitmap which contain several images that represent an image sequence if animated. I guess what I would like to do (and can do) is load the bitmap into an ImageList then 'somehow' animate the imagelist onto a Windows form. The actual animation would occur in response to a lon...more >>


Bitmap shrinks when passed to a function
Posted by Mark Raishbrook at 11/26/2006 1:18:01 PM
This is driving me mad. I have two functions, the first of which (ProcessBitmap) calls the second (Blur) and passes in a bitmap as one of its arguments. For reasons beyond me, the bitmap is being shrunk as it gets passed. Actually, the bitmap itself remains the same size, but the pic within ...more >>

Font ctor throws exception, how?
Posted by DrawMusic at 11/25/2006 11:11:01 AM
I had a customer report an exception which seemed to be thrown by the Font ctor when the font was missing (my code tried to create a "Verdana" Font object and he had deleted his Verdana font). However, I can't repro the exception on my PC. When I try to create a Font with a nonexistent face...more >>

Draw a single line using console application in J#.Net
Posted by narendar.nallapu NO[at]SPAM gmail.com at 11/22/2006 9:56:57 PM
Hi am Narendar.Am working on graphics in J#.net.I want to draw a single line using console application in J#.net. Please any body can provide a code for this......Either in C# or J#...more >>

Losing pixels from edge when resizing and using interpolation
Posted by Klaus Jensen at 11/22/2006 3:59:54 PM
Hi I have now spent the better part of two days trying to solve this problem, and really hope somebody here can help me. When i resize an image, and use antialias, I lose important image information. This is the code: [code] Dim scale_factor As Single = 0.25 'scale to 1/4 size Dim ...more >>

gdip exception
Posted by Paolo Niccolò Giubelli [Axettone] at 11/21/2006 11:18:02 PM
Hi folks! I made a simple application in c# 2.0, and I successfully installed it on many computers (windows xp pro). The .net framework v. 2 was previously installed of course. On a SINGLE computer, the application start but it crashes immediatly saying "Unhandled exception..", so i surrounded...more >>

Drawing in a tab page leaving artifacts
Posted by thatsastounding NO[at]SPAM gmail.com at 11/21/2006 12:53:28 PM
I have a custom button control that draws a rounded rectangle. When clicking the button, it gets smaller by a pixel on each side. In the OnPaint method, the first line is: e.Graphics.Clear(this.Parent.BackColor); this clears the drawing surface of my button so the next state can be shown...more >>

Display text in textbox with leaving space from both ends.
Posted by sharma.lalitm NO[at]SPAM gmail.com at 11/21/2006 12:52:59 AM
Hi, my prob is that i have to print text in textbox with leaving some space from both left and right boundries. and that space is to be calculated at run time. it should behave normally within the constrained area. actually i have to display some controls at both ends, and no of controls to be disp...more >>



Other printing problem (resolution not honored)
Posted by Lloyd Dupont at 11/17/2006 12:00:00 AM
Before printing I create an instance of PrintDocument as Follow (beware, pseudo code) //============================== PrinterResolution pr = new PrinterResolution(); pr.X= 600; pr.Y= 600; pr.Kind = PrinterResolutionKind.High; PrinterSettings printer = new PrinterSettings(); printer.Pr...more >>

Printing Problem
Posted by Lloyd Dupont at 11/17/2006 12:00:00 AM
Before printing I create an instance of PrintDocument as Follow (beware, pseudo code) //============================== PaperSize ps = new PaperSize(); ps.Kind = PaperKind.A3 ps.Width = 1169; ps.Height = 1654; PrinterSettings printer = new PrinterSettings(); printer.PrinterName = "my pri...more >>

Drawing in Greyscale with C#
Posted by chapmjw at 11/16/2006 9:48:52 AM
In a recent post I asked the question how to draw in greyscale with c# and CreateDibSection was suggested. It was a good suggestion but, I'm having some problems and would appreciate any advise. I'm not sure the DIB being setup correctly, I'm getting pointers returned, and no errors. I then t...more >>

differenet type of images saving as one png image and it is working fine
Posted by koti at 11/15/2006 11:14:03 PM
Hi i am saving different type(BMP,JPEG,JPG,TIF,GIF,PNG) of images into a single PNG image by using "System.Drawing.Bitmap" and that bitmap saving as PNG. bitmap.save("a.png"); it is saving good but i try to optimize this PNG with different bit depths but bit depth is not canging. advance...more >>

LinearGradientBrush and alpha values
Posted by Flack at 11/15/2006 12:59:01 PM
Hey guys, I was trying to create a LinearGradientBrush that will have the same start and end colors but have the alpha value of the first color be 0 and the end color be 255. LinearGradientBrush lgb = new LinearGradientBrush(this.ClientRectangle, Color.FromArgb(0, Color.Yellow), Color.Fr...more >>

WPF
Posted by Shawn B. at 11/15/2006 9:49:23 AM
Is there a seperate newsgroup for Windows Presentation Foundation? I haven't been able to find one that looks obvious. Thanks, Shawn ...more >>

what's wrong here: scan pass for transparency
Posted by pamela fluente at 11/15/2006 9:21:26 AM
I am doing experiments with the scan pass to test transparency of a rectangular portion of a bitmap I must be doing something wrong: 1. On the second msgbox I get an exception saying the bitmap is already locked. Why? 2. It never returns true (some pointer is wrong?) 3. Removing the ...more >>

Printing graphics/text that span multiple pages
Posted by Jeff at 11/15/2006 8:30:48 AM
(this is a "scaled down" version of a previous post to hopefully attract more responses) Scenario: 1) I have a class that renders graphics and text onto a passed-in HDC. 2) The class doesn't know or care if the DC is a display (usually a PictureBox) or a printer 3) The "size" of the graphi...more >>

GDI+ is it possible to print to file?
Posted by Jason at 11/14/2006 9:13:15 PM
Hi, I have a VB.NET reporting application that produces graphical reports to screen which then need to be printed on a remote postscript printer at a later date. I wish to 'print to file' so instead of sending the postscript directly to the printer I'd like it to go into a file of my cho...more >>

Graphics object for 8 bit Bitmap?
Posted by chapmjw at 11/14/2006 2:20:34 PM
Is it possilbe to use the Graphics object for drawing onto a bitmap that is 8bit greyscale or 8bit indexed color. My application has to create a huge bitmap and I need it as small as possible. Has anyone got a suggestion better than creating my own drawing functions and drawing onto a byte ...more >>

fast way to test transparent areas ?
Posted by pamela fluente at 11/13/2006 12:47:57 AM
Hi I have a bitmap 32bpp PARGB. Given any rectangle (any portion of the bitmap) I need to test if the rectangle is transparent. How can I do this in a smart way? I tried checking pixel by pixel, but it's by far to slow for my purposes. Tried sampling the boundaries, but there could be some ...more >>

How to get tranformed bounds?
Posted by Fabio at 11/12/2006 1:09:03 PM
Hi all! Let's say I have a Rectange(10,10,50,50). Get its bounds are simple: it is the same rectangle :) Now, let's say I apply a transformation to the Graphics on wich I want to draw the rectangle. Can I get the new rectangle bounds? Attention, I don't want the coordinates of the rotated...more >>

GDI+ Transparent images and black pixels
Posted by Christopher at 11/11/2006 1:10:34 PM
I have managed to use a ColorMatrix to draw semi-transparent images to a buffer and draw the buffer to the window but any pixels that are black (000000) never go transparent. In other words, the whole image draws semi-transparent except for any pure black pixels. Does anybody know why? How can I get...more >>

Graphics on form get "erased" when dragging object over it
Posted by Jeff at 11/10/2006 6:03:12 AM
I'm using the various drawing tools to render graphics onto a user control (DrawRectangle, DrawImage, etc). The graphics render just fine. However, they don't "persist". If you drag another window over the user control, the graphics get erased, leaving the user control's background color. Th...more >>

Doubt
Posted by Hari Shankar at 11/9/2006 11:06:30 PM
Hello Guyz We are planning to simulate the front panel of a Car Radio in PC. We want to use it for demo purposes. Especially in situations where we don't have the actual hardware available, we want to simulate all the user actions from the PC itself. The project is going to be for 3 months. ...more >>

Drawing a .net control to printer using inches
Posted by Jeff at 11/9/2006 10:18:15 AM
Scenario: I'm creating controls which need to be able to render themselves to a passed-in device context handle. These controls shouldn't care what the DC is (printer, monitor). They need to render themselves in real measurement: inches. I want them to be 8 inches wide. Problem: One of m...more >>

BitmapData
Posted by Le Minh at 11/9/2006 12:00:00 AM
i wonder what happen if we use LockBits: BitmapData data = tmp.LockBits(new Rectangle(bx, by, width, height), ImageLockMode.ReadOnly, PixelFormat.Format8bppIndexed); where Rectangle is not (0, 0, width, height). Ex (10, 10, 50, 50). And what scan0 is stand for? thanks for support! ...more >>

SetPixel() with a custom color?
Posted by Jim Bancroft at 11/9/2006 12:00:00 AM
I must be missing something obvious, so apologies in advance; I need to set a pixel in a bitmap to a color I'm creating by hand. How can I do this? It would go something along these lines: myBitmap.SetPixel(x, y, new Color(23, 44, 22)); ....where the 23,44,22 represent the RGB values I'm...more >>

GIF - Need help on bad image quality
Posted by Jeff at 11/7/2006 8:47:24 PM
Hey ASP.NET 2.0 I created an image in PhotoShop XI and added it to my asp.net 2.0 project. In my website project I have this code: <asp:TableRow> <asp:TableCell> <asp:Image ID="imgBar" runat="server" ImageUrl="~/Network/Bar.aspx" /> </asp:TableCell> </asp:TableRow> Whic...more >>

clipping?
Posted by Ron Ayoub at 11/7/2006 5:11:14 AM
I'm studying the behavior of OnPaint during resizing by some experiments and I'm finding that not only is the paint event ClipRectangle property set to the appropriate rectangle but the clipping region of the Graphics object is also set to exactly that part of the form that needs to be repainted...more >>

{"A generic error occurred in GDI+."}, need help on this
Posted by Jeff at 11/6/2006 9:40:17 PM
Hey ASP.NET 2.0 This code below causes an {"A generic error occurred in GDI+."} exception at the : "imageFile.Save(Response.OutputStream, ImageFormat.Png);" line. Any suggestions on what I should do to solve this? Image imageFile = Image.FromFile(Server.MapPath("~/Images/barometer.png...more >>

please help, bad image quality
Posted by Jeff at 11/6/2006 1:16:45 PM
Hey ASP.NET 2.0 I created an image in PhotoShop XI and added it to my asp.net 2.0 project. In my website project I have this code: <asp:TableRow> <asp:TableCell> <asp:Image ID="imgBar" runat="server" ImageUrl="~/Network/Bar.aspx" /> </asp:TableCell> </asp:TableRow> Whi...more >>

[newbie] drawing in asp.net
Posted by Jeff at 11/6/2006 12:07:44 PM
Hey asp.net 2.0 I'm experimenting with drawing in asp.net 2.0. Below are some code I'm playing around with. In asp.net 2.0 I want to create dynamic images (images which are created by saving the drawing to the Response.OutputSteam - bitmap.Save(Response.OutputStream, ImageFormat.Gif)) ...more >>

type directly on graphic object: caret ?
Posted by pamela fluente at 11/6/2006 1:31:03 AM
howdy guys, I would need to type characters directly on a graphic object in response to key press. I want to be able to control globally the char and words spacing, justification, etc. I guess I need to measure both chars and string. For that, there should not be much problem with GDI+, usi...more >>

Loading Raster Font Bitmaps?
Posted by Jude Martin at 11/4/2006 12:02:48 PM
I know that .Net does not support .FON font types, but does anyone have a suggestion of how to load individual raster font character bitmaps from a ..FON file? I'm trying to find a way to display fonts at 6 to 8 pixels high and have them look decent. Any suggestions would be great. Jude ...more >>

Looking for a good color reduction algorithm ...
Posted by Joergen Bech NO[at]SPAM at 11/3/2006 8:30:40 PM
Does anybody know of any color reduction algorithm or library I can use with .Net? I need to do high-quality color reduction to a few colors, e.g. 6-12 colors rather than the usual 256. In other words, I am not looking for a 256-color function for GIF-images, but a general- purpose library ...more >>

How to draw text to fit a line
Posted by Valerie Hough at 11/3/2006 11:22:42 AM
Is there a way to draw text that will line up nicely along a polyline that has bends in it (i.e. the way one would label a map) without drawing the letters of the label individually as the line turns? I'm not talking about rotating fonts. Thanks in advance. ...more >>

Region to Bitmap - Form Slow to Show
Posted by Phil Jones at 11/2/2006 12:00:00 AM
Bob. Thanks for your article on converting a bitmap to a region (http://www.bobpowell.net/region_from_bitmap.htm). I've implemented that method - and I find that when I apply the region to the form it takes a long time for the form to then reveal itself (as in 2 - 5 seconds). I assume t...more >>

Convert color-image to bw *fast*
Posted by henning.friese NO[at]SPAM gmx.de at 11/1/2006 1:27:05 AM
Hello everyone, I'm looking for a fast way to convert 32bpp-bitmaps to 1-bpp indexed bitmaps. The methods I've found on the web look something like this: public static void ConvertToBW(ref Bitmap objBmp) { Bitmap objNewBmp = new Bitmap(objBmp.Width, objBmp.Height, PixelFormat.Format1bppIn...more >>


DevelopmentNow Blog