all groups > dotnet drawing api > may 2006
Filter by week: 1 2 3 4 5
Is there a limit in DrawLines
Posted by Peter Klinge at 5/31/2006 12:00:00 AM
Hi,
I'm using Graphics.DrawLines (Pen, PointF[]) to draw a long curve with
thousands of points - works perfectly on printers.
Now I have found, that the preview functionality seems to have problems,
if I pass more than 6000 or 7000 points. Now I'm a bit concerned, that
there are different ... more >>
Icon over bitmap
Posted by Victor at 5/29/2006 12:08:46 PM
Hi everybody,
I encounter a problem when painting a window in two programmatically
different applications that should display the same kind of picture.
The picture consists of a bitmap on whose top there appears an icon.
The problem is that in one app the picture is always stable, while in
th... more >>
Drawing text to a Bitmap has horrible looking output
Posted by Lloyd Dupont at 5/28/2006 12:13:32 AM
I tryed to do a bitmap export in my app by creating a bitmap, drawing to it
and saving the file.
Something like that
void SaveToFile(string pngfile)
{
using(Bitmap bmp = new Bitmap(200, 200);
{
using(Graphics g = Graphics.FromImage(bmp))
g.DrawString("Hello!", ... more >>
.NET Bitmap's Graphics.DrawString() // HDC ExtTExtout issues
Posted by Lloyd Dupont at 5/27/2006 11:16:47 PM
In my .NET application I have some text rendered through GDI.
It draws and print nicely.
Now I would like to implement image export.
So I create a
new System.Drawing.Bitmap(width, height)
then I create a Graphic g = Graphics.FromImage(bmp)
then I use
HDC hdc = g.GetHdc();
and use ExtTextOu... more >>
Drawing in a user control
Posted by feripar NO[at]SPAM gmail.com at 5/27/2006 1:21:28 PM
Hello!
I am creating a user control with several methods, each method should
draw something in my user control; from a winform, I should use:
myControl.ShowBands or myControl.ShowLabels, etc.; but I don't know how
to do that, because all the logic to draw should be in the Paint event,
but each ... more >>
Clear an Image
Posted by bern11 at 5/25/2006 10:01:42 PM
How do you clear an image in a Picturebox control? Do you simply set it
to nullptr?
ie: pictureBox1->Image = nullptr;
Do you have to rely on the garbage collector or can you deterministicly
release the memory associated with the image?... more >>
Color --> Grayscale
Posted by Shawn B. at 5/24/2006 5:35:28 PM
How do you convert a 24-bit color image into a 256-shades-of-gray image?
Thanks,
Shawn
... more >>
Wrong palette of BMP Image (if gray ok)
Posted by Matteo at 5/24/2006 3:22:41 AM
Hi,
i sent image byte via bt from j2me phone to c# application,
after i have to create image using this code:
....
byte[] pixels
....
Bitmap bmp = new Bitmap(160, 120, PixelFormat.Format8bppIndexed);
BitmapData d = bmp.LockBits(new Rectangle(0, 0, 160, 120),
ImageLockMode.WriteOnly, Pi... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Bitmap analysis
Posted by Adrian at 5/24/2006 12:00:00 AM
Hi all
We are working on a large project. Main functionality is accessing database
with ado.net. A small corner of the project contains some graphics (Bitmaps)
analysis. We all know a lot about ADO.Net but not so much about graphics. So
I hope this newsgroups can point us to the right way. By ... more >>
Problem with PixelFormat.Format16bppGrayScale
Posted by Keijo at 5/23/2006 11:37:01 AM
I have a problem when using Bitmap in PictureBox. I have been using several
PixelFormats without problems but when I tried to use Format16bppGrayScale I
got an exception = "Parameter is not valid"
Here's the very simplified code:
Bitmap bmp = new Bitmap(100, 100,
PixelFormat.... more >>
Is this an error in System.Drawing.Printing.PaperSource?
Posted by Richard Kure at 5/22/2006 1:01:42 PM
I have found a possible error in the PaperSource class in the .NET framework
v1.1.
The possible error lies in the Kind-property, if the Kind value exceeds 257,
then it just returns 257.
It looks like this :
--- hp color LaserJet 2550 PCL 6 ---
"Kind", "Name"
15 Automatically Select
... more >>
Error in PaperSource class
Posted by Richard Kure at 5/22/2006 12:17:11 PM
The PaperSource class is used to define trays on printers, which is quite
nice, untill I found an error in it,
\\DGM-SDG-AD1\hp color LaserJet 2550 PCL 6
15 Automatically Select
261 Printer Auto Select
260 Manual Feed in Tray 1
259 Tray 1
258 Tray 2
1272 Uns... more >>
Primitive Class, Transform and hit test
Posted by JB at 5/22/2006 5:34:01 AM
Hi,
I am using Bob's primitive class to render objects on the screen, and
perform hit tests to see if the mouse moves over any object (code below).
Public Overridable Function HitTest(ByVal p As Point) As Boolean
Return (New Rectangle(Me.m_Location, Me.m_Size)).Contains(p)
End Functi... more >>
Why the Marshalling / Copying?
Posted by bern11 at 5/21/2006 4:12:25 PM
The following is a snippet right out of the LockBits help:
IntPtr ptr = bmpData->Scan0;
....
....
// Copy the RGB values into the array.
System::Runtime::InteropServices::Marshal::Copy( ptr, rgbValues, 0,
bytes );
// Set every red value to 255.
for ( int counter = 0;... more >>
changing brightnes without changing the black color
Posted by gb at 5/21/2006 2:18:53 AM
hi,
i am using a color matrix to change the brightness and contrast of a
bitmap, but i can't
make the black color stay black when changing the brightness.
is it impossible since changing the brightness is adding the same
number to the R,G and B?
if it's possible, how do i do it?
tha... more >>
Picture Box Issue
Posted by russ.haley NO[at]SPAM gmail.com at 5/19/2006 3:15:03 PM
***Please let me know if this is the correct forum for this question.
I am having problems with a picture box as follows:
I have an asynchronous WinForm application that communicates with an
ASCII based text radio and saves data to a database. The 'guts' of the
functionality have all been w... more >>
How to convert pixels to Inches?
Posted by Lloyd Dupont at 5/19/2006 12:00:00 AM
In one of my view I should do precision rendering.
Each character, string, etc.. should be at a particular, WYSIWIG position in
Inches.
To achieve this quality when drawing I set the Page's unit to be Inch, like
that:
==>>> e.Graphics.PageUnit = GraphicsUnit.Inch;
Now my problem is I shoul... more >>
Looking for 3rd party graphics/image lib
Posted by Paul at 5/18/2006 11:32:22 AM
Does anyone have any recommendations on a 3rd party component (COM or .Net
component) that I can plug into my solution that'll provide basic image
functionality (e.g. croping, pasting, resize, multi-format support
jpg/tif/gif,etc)?
Thanks very much!... more >>
Drawing Image Question and Problem
Posted by Tom at 5/18/2006 9:56:02 AM
I am using .NET 2.0 and building a custom control. There are multiple
graphics elements that I would like to render on the surface. When drawn
together they form the complete control image but need to be managed
separately because they might have different scale, units, move indendently,
a... more >>
Font toLogFont and back is not same Font
Posted by Darrin at 5/18/2006 9:36:24 AM
With this code:
Font f = new Font("Microsoft Sans Serif",20 );
LOGFONT lf = new LOGFONT();
f.ToLogFont(lf);
Font newFont;
newFont = Font.FromLogFont(lf);
f and newFont are not the "same" .Net Font. Can anyone comment on this?
... more >>
Hit-Testing a GraphicsPath.
Posted by Kieron at 5/17/2006 10:35:02 AM
Hi,
I'm trying to hit-test a rectangle thats been rotated 45 degrees, however
the IsVisible and IsOutlineVisible don't appear to take the transformation
into account.
Does anyone know of a solution? I don't want to manually rotate the Point
I'm passing in because I don't know if the obje... more >>
Bitmap.Save in GIF format dithers image
Posted by nok at 5/17/2006 6:24:02 AM
I save a set of subsampled images to display when the user zooms into a map.
At runtime I draw a circle around a point-of -interest in the image
(Graphics.DrawEllipse). If I use ImageFormat.Jpeg for the resulting image,
the¨
image is OK but the circle is blurred which is natural in jpeg.
If ... more >>
How can I change the default printer
Posted by Alex at 5/16/2006 9:31:01 PM
Hi, I have a free (grin) third party component I am working with which has a
Print() method. The gotcha is that it prints only to the default printer; it
doesn't give me the ability to indicate what printer to use. I am semi-new to
..Net and for the life of me I can't figure out how to designa... more >>
repeating an image across a rectangle on the X axis
Posted by Smokey Grindle at 5/16/2006 11:11:53 AM
is there a way (like you can do with a web site table) to take an image and
repeat it along the X axis of a given rectangle? thanks!
... more >>
Setting the Opacity of a Control (2003 vs 2005)
Posted by Mark Denardo at 5/15/2006 5:51:00 AM
(I'm going to try in this newsgroup; nobody in the VB group seems to answer
my imaging questions over there)
Can someone tell me why setting the opacity of a control in 2005 no longer
works like it did in 2003 (using Color.FromArgb)?
In 2003, I could make the opacity of the text of a Label ... more >>
GPath performance issue
Posted by Miro at 5/15/2006 12:50:01 AM
Hello!
I have a webpage (FW1.1) in which some heavy drawing takes place (code
behind). In some cases I call the DrawPath(...) function 20 000-30 000 times.
This works well everywhere except in one environment. The time to draw the
geometries is about 20-30 times higher than everywhere else.... more >>
BufferedGraphics and translations
Posted by Marcin Rzeznicki at 5/14/2006 3:06:55 PM
Hello,
I am experiencing lot of problem with BufferedGraphics rendering. In on
paint of my control I do:
float xOffset = ComputeXOffsetSomehow();
float yOffset = ComputeYOffsetSomehow();
BufferedGraphicsContext doubleBufferContext =
BufferedGraphicsManager.Current;
BufferedGraphics backBu... more >>
convert BMP to specific format
Posted by Nikolay Evseev at 5/12/2006 7:54:02 AM
Hello,
I need to convert a monochrome BMP according to the format specified below.
This needs to be done in compact framework 2.0.
The format needed:
To represent the 16x16 square box, the data (shown in boldface) is as
follows. bytes bits
HEX BINARY
FF FF 1111111111111111
80 01... more >>
Capture and restore a rectangle of pixels FASTEST way
Posted by sandrapacino NO[at]SPAM libero.it at 5/11/2006 3:40:01 PM
I have a BITMAP, say it's w=200 x h=100 pixels.
I have a rectangle *which has a border* of 3 pixels. (It is not
necessarily all contained in the bitmap. Let say the rectangle is x=
-1, y=50, w=100, h=100 (with a border=3)
I want :
1. to store in memory all the pixels that are covered by the... more >>
ZoomPicBox: Moving scrollbars in a Zoomed Image
Posted by blackForest1000 NO[at]SPAM hotmail.com at 5/11/2006 8:26:01 AM
I have implemented a custom PictureBox as Bob Powell instructs (thanks
for your code!) using a Matrix transformation in the OnPaint method.
Im trying to scroll the image dragging it with the mouse. The mousemove
event =ECs captured moving the scrollsbar accordingly. This works ok in
a non-zoom... more >>
VisualStyleRenderer won't work, crashes control... any bug fix?
Posted by Xafier at 5/11/2006 1:25:23 AM
Hi
I'm working on making a TreeView and re-doing the painting myself, but
I'm having a problem with this code:
private VisualStyleRenderer glyphOpen = new
VisualStyleRenderer(VisualStyleElement.TreeView.Glyph.Opened);
and any code similar... for some reason whenever those lines are
decla... more >>
Picture box with signature needed to be transparent, to view Photo of another picture box
Posted by Juna at 5/10/2006 9:58:47 PM
Hello Bob powell,
I have seen you solving problem of many peoples, so i hope you
can also solve my problem.
Well I am trying to Make a program to print the ID cards.In the window
form i have two picture box, one is for the photo of the students and
one to hold the signature of the Prin... more >>
Control for drawing
Posted by dave at 5/10/2006 2:53:01 PM
Hello:
Does somebody know what the best control for drawing on ?
Thank you,
dave
... more >>
GraphicsPath.Transform to rotate around one of its points
Posted by sod0783 at 5/10/2006 2:52:01 PM
I'm taking a rectangle and using a Matix and GraphicsPath to draw it rotated
about its upper left corner. The problem is GraphicsPath.Transform changes
the upper left point in the path slightly, so that it is no longer the same
as m_rectanglef.Location. This is especially a problem when
m_... more >>
Re: Graphics.PageUnit problem... (spelling checked.. ;-(
Posted by Lloyd Dupont at 5/10/2006 2:19:32 PM
I have to do some WYSIWIG rendering.
Because I need to know exactly where is what and have to have the same
output on both the screen and the printer I decided to change my Page unit
to Inches.
As I was testing my first thought was to draw red outline of some relevant
rectangle.
And here ... more >>
Graphics.PageUnit problem...
Posted by Lloyd Dupont at 5/10/2006 2:00:05 PM
I have to do some WYSIWIG rendering.
Bacause I need exactly where is what and have the same output on the printer
I decided to change my Page unit to Inch.
As I was testing my first though was to draw read outline of some relevant
rectangle.
And here I had my 1st encouter with those infamou... more >>
text in outputstream
Posted by John Hopper at 5/10/2006 1:11:02 PM
Hello,
If I
Response.Write("hello")
before I
image2.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Gif)
then I see miscellaneous characters where the image should be.
When I reverse the order of the statements above then I don't see the text
at all.
Is there... more >>
Change ColorPalette
Posted by César Chalom at 5/10/2006 2:10:44 AM
Hello,
Is it possible to change the colorpalette of a GIF image without using
Lockbits ?
I'm doing the following :
1 - load any bitmap
2 - save as GIF (MS GDI+ saves using its default half tone palette)
3 - load this just created image
4 - retrieve the colorpalette
5 - change an entry... more >>
Problem with Bitmap::Save
Posted by imwwz NO[at]SPAM 163.com at 5/9/2006 11:24:20 PM
I have a problem when using Gdiplus Bitmap::Save: I can't save the
bitmap back to the file from which the Bitmap object is constructed.
I learned from Bob Powell's Gdi+ Faq that there is a solution in C# to
this problem, but right now I'm programming with VC++, and I don't want
to program with m... more >>
Do I need to reinvent wheel ?
Posted by dave at 5/9/2006 10:35:01 PM
Hello:
I have application that displays graph as line.
Data that feeds this graph is updated every 1 Sec.
Q1: What the best way to accomplish this task ?
Q2: The same questions when graph is a sequence of rectangles?
I'm new to this subject but i beleive its old topic.
Does somebody... more >>
Multiframe Bitmap resolutions?!?!?
Posted by jorge.colaco NO[at]SPAM gmail.com at 5/9/2006 10:14:21 AM
Hi guys,
- I'm trying to load some jpeg's and 1 frame tiff's to bitmaps. Done!
I use the Bob Powell GDI+ method
(http://www.bobpowell.net/generating_multipage_tiffs.htm) and
everything seems ok, but, when look closely i found that all the pages
loaded from .jpg's files, doesn't respect the re... more >>
Risk matrix.
Posted by Piotrek at 5/7/2006 12:47:48 AM
Hi all.
I am creating an windows app in Framework 2.0, which has to draw a risk
matrix based on data supplied by users. I wouldn't like to do it from
the scratch, so I am looking for some library, which could help me.
Does anybody know some library designed to drawing risk matrixes?
If no... more >>
Problems with translate transform
Posted by Marcin Rzeznicki at 5/6/2006 2:58:27 AM
Hello
I am having curious problem with Graphics.TranslateTransform. My
OnPaint handler in my custom control (derived directly from Control)
basically has the following form:
DrawWithVisualStyle( pe.Graphics );
pe.Graphics.TranslateTransform( ... );
DrawConte... more >>
fastest (non bit-blitting) way to move a large bitmap around ?
Posted by Bill Woodruff at 5/5/2006 11:34:56 PM
VS 2005
Just for the recreation of it, and to 'refresh,' my mental .NET drawing
buffer, I wrote some code that moves a medium-large .jpg (4472,1360, 24bps)
around on a 1024x768 monitor. I put a PictureBox on the Form and set its
Image property to the bitmap as an imported resource.
I use... more >>
How find a color
Posted by Carlo (mcp) at 5/5/2006 4:16:30 PM
Hi all
I'm looking for a way to find a color of the surface of a control at a given
point.
ie:
Dim re as Rectangle = Me.ClientRectangle
dim co as Color = GetColorAt(re, New Point(0, 0)) 'This finds the color in
the upper left corner of the control
Any idea for GetColorAt?
Thank you... more >>
Creating an image pixel by pixel on the fly
Posted by Klaus Jensen at 5/5/2006 2:15:35 PM
Hi
I am developing a heatmap-component, and I need to define the color of each
pixel individually.
How do I do that most effeiciently?
I cant seem to find a way to draw individual pixels, short of creating 1x1
line or rectangle-objects.
Is that the way to go, or am I missing somethin... more >>
How do I load multiple pictures into a picturebox and view them consecutively like an animation
Posted by helpneeded_bad at 5/4/2006 3:41:33 PM
Hi all -
I have 8 images (maps) that I need to load into a picture box and then based on a button pressed, animate them (like what happens on this site http://www.goes.noaa.gov/GSSLOOPS/wcwv.html)
How do I do that? The Imagelist/Timer does not work as the imagelist only can take images up to... more >>
Keep control from redrawing
Posted by rwakelan at 5/3/2006 8:58:44 AM
I have a control that shrinks and grows depeding on the user's actions
(similar to the toolbox when unpinned in VS). When the control is
docked to the top or left, it works perfectly. But when it is docked
to the bottom or right, it doesn't. You can see the form distinctly
resize the control ... more >>
"invalid Parameter used"
Posted by Gerrit at 5/3/2006 1:36:53 AM
I want to upload a TIFF Picture which I created with mspaint.exe (just
opened a jpeg and then saved it as tif file). Now I want to upload it
using the following code:
System.Drawing.Image Bild = System.Drawing.Image.FromStream
(PostedFile.PostedFile.InputStream);
th... more >>
Convert gif image to 1bit pcx file
Posted by Beginner at 5/1/2006 2:23:01 PM
I need to convert the images to a 1bit (black and White) pcx (binary) file. I
can read the image to a stream and write it a file. But I guess this is not
it. Do I have to encode it to pcx or something like that? If so how do I do
it?
Please Advise.
Thanks.... more >>
|