all groups > dotnet drawing api > august 2004
Filter by week: 1 2 3 4 5
How to draw a chord without interop?
Posted by smartkid at 8/31/2004 11:59:30 PM
hi,
The Graphics class does not provide a DrawChord method. So what is the
easiest way to implement something like DrawChord(Pen pen, Rectangle rect,
Single startAngle, Single sweepAngle)?
Another question is GDI (not GDI plus) does not provide a method to draw
a chord with angles... more >>
what is the best way to update a large bitmap with small bitmaps?
Posted by assaf at 8/31/2004 11:33:37 AM
hi all.
i have a large bitmap that i display in my main window.
as part of my app,
i need to constantly update differnet areas of this bitmap
with new small bitmaps.
what is the best way to do this?
assaf
... more >>
How to save an 8-bit BMP file?
Posted by mbray NO[at]SPAM ctiusa.com at 8/31/2004 9:11:30 AM
I have a need to save a windows bitmap file in ONLY 8-bit color from a
24-bit Bitmap object. I tried grabbing the BMP imageCodec object and
creating an EncoderParameter for the Encoder.ColorDepth parameter
specifying a value of 8, and using these in the Save(...) operation,
but it still saved t... more >>
BitBlt Managed Version
Posted by assaf at 8/29/2004 6:43:23 PM
hi all
i am porting some code from C++.
i have two bitmaps.
i am using BitBlt to transfer pixels from one to the other.
now, in dotnet, i have again, two bitmaps,
but i don't know how to transfer pixels from on to the other.
so what exactly to i do?
assaf
... more >>
Get DC for sys.dr.bitmap
Posted by Thomas Fisher at 8/28/2004 7:59:30 AM
Hello All,
I've been working on this for several days now and could use some direction
so thanks in advace for any help.
I have a COM method which needs "the handle to the device context for the
bitmap." I'm guessing that it's expecting a DIB but I'm not certain. If so,
how do I create a D... more >>
is there a way to copy multi gif images to a jpeg without losting color?
Posted by davidw at 8/27/2004 10:08:58 PM
I created a image with true color :
mapimage=new Bitmap(mapwidth,mapheight,PixelFormat.Format32bppRgb);
and then use DrawImage to draw some dozens of gif file on it, but some
colors lost, I think the image has enough colors.
Any idea?
Thanks!
... more >>
Any GUI Design Guide?
Posted by knarty55 NO[at]SPAM yahoo.com at 8/27/2004 1:56:14 PM
I am looking to spice up my app with rich controls and eye-catching
color depth, but I am not a graphic designer (I am programmer who
can't even color coordinate my own clothes). Are there any books out
there like a GUI design guide?
GDI+ and DirectX allow for some great looking gadgets, but i... more >>
How can I draw text with two colors? thanks!
Posted by davidw at 8/27/2004 10:27:39 AM
I found some images have text that draw by two color, for example, one
purple pixel and then one white pixel, the background is purple, so the text
kind melt into the background, make it look not so strong. How can I draw
such text in C#? I am thinking about some kind of mask, but not sure, any
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
serialize graphicspath
Posted by JZ at 8/27/2004 9:19:35 AM
Hi,
I'm writing a small graphics program, a sort of scribble pad.
I need to be able to save a graphics path.
I think my question is how do I serialize a graphicspath.
I want to do something like this...
Dim FileStream As Stream = File.Open(pstrFileName, FileMode.Create)
... more >>
ExtFloodFill using colors with bitmaps
Posted by Daiane at 8/26/2004 1:13:09 PM
When i create a graphics using CreateGraphics method from Form class
everything is works right with my FloodFill method.
But, when i creat a graphic using Graphics.FromImage(b); (my bmp) ALL bitmap
is filled with the especific color.
How do i solve it ????
_______________
procedure ... more >>
Complex Alpha Masks
Posted by Phil Jones at 8/26/2004 12:25:04 PM
I've started investigating how to draw an image cut out with a mask (like
photoshop's channels). I've been looking at Bob's GDI+ FAQ article entitled
"Region from Bitmap" (thanks Bob!), but here's the problem.
From my understanding of what's going on here - a [Region] is being created,
which ... more >>
High resolution images in VB.NET
Posted by Johnny Granberg at 8/26/2004 12:35:55 AM
Im trying to make a software in VB.NET that is supposed to handle high-res
images, ive discovered theres a limit in the size of the bitmap object
around 10000x10000 pixels.
The program takes 3 input files and then create new files with
parts of the input files.
so basicly i load the inpu... more >>
Need help with ExtFloodFill in C#
Posted by Gyorgy Bozoki at 8/25/2004 11:03:03 PM
Hi all,
I searched for this for a long time, found nothing so far.
I have a Bitmap object in memory, with some content - this bitmap is then
displayed on screen. I have a brush object (hatch/texture/etc. - I need all
of them to work) which I want to use to paint an area of the picture usin... more >>
Font.Dispose() and ArgumentException
Posted by Cam at 8/25/2004 10:59:07 PM
I've got a button on a form with the following click eventhandler:
private void button2_Click(object sender, System.EventArgs e)
{
Font tempFont = this.label1.Font;
this.label1.Font = new Font(this.label1.Font.FontFamily, 8.25F);
tempFont.Dispose();
}
If this code is executed twice (tw... more >>
Flipping an Image - 1 pixel offset on single plane (BUG?)
Posted by Phil Jones at 8/25/2004 7:14:44 PM
Hey Bob,
I've been doing some image flipping as per the sample on your GDI+ FAQ
(http://www.bobpowell.net/drawing_an_image.htm)
Specifically:
Rectangle dest = new Rectangle(10,10,100,100);
Rectangle src = new Rectangle(0,img.Height,img.Width,-img.Height);
g.DrawImage(img,dest,src,Gra... more >>
C# Screensaver - render causing 100% CPU usage
Posted by wushupork NO[at]SPAM gmail.com at 8/25/2004 2:53:50 PM
I have written a screensaver application in C# .NET and have noticed
that whenever the animation loop is running - CPU usage always spikes
up close to 100%. My application uses a paint thread which is set at
100ms.
the program looks sort of like this:
// constructor
public Form1()
{
I... more >>
C# question: how do I make the ProgressBar dimmed/gray
Posted by Maka Sili at 8/25/2004 10:27:28 AM
Using ProgressBar.Enabled = false does not dim the progress bar.
There must be a way. I hope somebody could guide me.
Thanks.
... more >>
disabled control's color
Posted by lukasz at 8/24/2004 4:57:42 PM
What're the system colors for foreground and background of a disabled
control? In fact, the foreground color of a disabled combobox (128, 128,
128) is not among SystemColors. Is there no standard for it?
... more >>
Invalid Parameter Used when creating Bitmap from File
Posted by reimann_axel NO[at]SPAM yahoo.de at 8/24/2004 1:32:51 AM
Hi all!
I'm really freezed by this problem. I'm creating a Bitmap from a
Jpg-File on a network-share using the Bitmap-class. It really works
fine but on one server, i get an "Invalid Parameter Used"-Exception
when calling Bitmap b = new Bitmap(path_to_jpg).
Here's the code-sample:
....
Fi... more >>
Z-order problem
Posted by G. Alper Alaca at 8/23/2004 12:45:56 PM
Hi, I draw some rectangles for some purpose, but all of those appears behing
controls such as groupbox,
panel. I want my drawings to appear on top. How can I make it?
Thanks.
... more >>
GetImage Method Doesn't Seem To Exist
Posted by Kris at 8/23/2004 9:56:21 AM
Hi All,
I'm trying to use the GetImage method in a ASP.NET project that I've created
but I keep getting an error stating:
The name 'GetImage' does not exist in the class or namespace ...
The project includes System.Drawing and I've even tried specifying the fully
qualified name System... more >>
Increasing the resolution of data points in a GraphicsPath
Posted by Lyndon at 8/23/2004 4:49:01 AM
Hi all,
I've created a GraphicsPath using some fixed data points that make a jagged
line. This jagged line is smoothed using the AddClosedCurve() method that
creates a cardinal spline curve, which is basically a series of curves, each
one defined by four points (start, end and two mid poin... more >>
transform points
Posted by lukasz at 8/21/2004 5:51:57 PM
I can't make Graphics' "native" points transform work the way I want it.
This code achieves the desired result:
Point pt1 = new Point(e.X, e.Y);
pt1.Offset(visibleX, visibleY);
PointF pt2 = new PointF(0, 0);
pt2.X = (float) ((float)pt1.X / scale / pixels_per_mm);
pt2.Y = (float) ((float)pt1.... more >>
Drawing and Animation (using Timers?)
Posted by Phil Jones at 8/21/2004 12:50:58 PM
I'm just wondering, in regards to animating a sequence (for instance I'm
looking at creating some sort of visual transformation between states wtihin
the control - like sliding things around) what's the general approach to
take?
I'm thinking of using Timers to force redraws of the control - an... more >>
Regions & DrawPath
Posted by FinallyInSeattle at 8/20/2004 3:29:01 PM
I'm drawing a shaped control using a version of the following code in the
OnPaint:
GraphicsPath path = new GraphicsPath();
path.AddRectangle(rect); // rect is previously
defined
Region region = new Region(path);
Pen penOutline = new Pen(Color.Black, 1.0f);
e.... more >>
Book on GDI+ using .NET
Posted by knarty55 NO[at]SPAM yahoo.com at 8/19/2004 10:29:47 AM
I'm getting started with GDI+ and I'm looking for a good book with
showing the most recent way of displaying data in cool graphics.
I'm looking to "spice-up" my data presentation with good looking
controls and deep color depth.
I'm not an artist, so I am also hoping for a book that goes into... more >>
Override ListView Paint events?
Posted by markr at 8/18/2004 5:44:33 PM
Hi, all:
I'm trying to subclass a ListView ("override" in C#) to change the graphical
behavior when an item is selected. Trouble is, I can't seem to find the
event. I overrode the OnPaint event in my derived class, but it never gets
fired.
Can someone please help me? My ultimate goal is ... more >>
Save Transparent Image
Posted by Andrew Deren at 8/18/2004 3:23:01 PM
Does anyone know of a way to save transparent TIF or PNG?
I looked at Bob Powels FAQ, but it only has saving for Gif and I need to
save it with 24bit color.
Thanks.... more >>
Reducing image size dynamicaly
Posted by Jorge Ribeiro at 8/17/2004 4:21:03 PM
Hello
I'm planning a .NET app that retrives an image from a binary field in a
database table
and presents it on the user browser, without doing tipical direct file
references in html (tag <img src='myimage.gif'> becomes <img
src='web_service?imgid=123'>)
before presenting my hole image ... more >>
Brush with a Image Mask
Posted by Phil Jones at 8/14/2004 6:45:41 PM
Is there a technique, or approach, that allows you to create a brush with
using an image to define it's shape (ie. a mask).
Pretty much like the way channels work in Photoshop - where the image White
the bursh shows through, and where it's black it's masked.
Anything like this - or am I goin... more >>
Extracting OCR from TIFF created with MS Office Document Imaging?
Posted by David H. at 8/14/2004 7:27:02 AM
Does anynone know of any way to use GDI+ to extract the OCR text from a TIFF
file that has been created in Microsoft Office using Office Document Imaging?
MODI embeds the OCR text right in the TIFF file.
I thought that the OCR might show up as a frame and be selectable with the
SelectActiv... more >>
Transparent Controls
Posted by Tony at 8/13/2004 11:48:50 PM
Hi all,
I have develop some compontents with transparent property. I can do it
partially, when there is only a parent container under it. When there are
other control behind it, the tranparent control on the top only paint the
parent background on it, and ignores the other controls' background u... more >>
Rotating a control ?
Posted by Zoury at 8/13/2004 10:19:04 AM
Hi Folks! :O)
I would need to rotate a control 180 degrees (and still be able to use it).
Does any one knows how to make this happens ?
I have a TrackBar control on a form with its TickStyle set to None and its
Orientation set to Vertical. For now the cursor (on the trackbar) is
pointing ri... more >>
The future of Drawing (come XAML/Longhorn)
Posted by Phil Jones at 8/13/2004 10:11:55 AM
I'm currently investing in learning the whole GDI+ thing and custom drawing
controls. And frankly, it's an unbelievable form of liberation to have this
type of power and control over visual style.
One question I do have, however, is in regards to future directions and
XAML. Without any real ... more >>
Transparent panels/controls.
Posted by Wernardt Toerien via .NET 247 at 8/11/2004 1:11:37 PM
Hi!=2E Im developing my first app in C# and am unfamiliar with the=
concepts of transparency=2E In my form there is a normal main=
panel with a background color,onto which controls are added to=
represent various objects=2E I need to draw lines between some of=
these objects,however,some of ... more >>
Error creating window handle
Posted by Ramana at 8/11/2004 12:23:21 PM
Hi,
I am working on a windows application (C#) which has number of tab pages
and each tab page contains large number of controls (labels, text boxes,
buttons etc).
After facing the window creation problem, I came to know that the maximum
no. of window handles per process is limited to 10000.
... more >>
REPOST: Displaying and Editing a Time value in a PropertyGrid
Posted by Chris Dunaway at 8/10/2004 11:36:23 AM
When using a PropertyGrid, I have an object with a Date property, but I am
only interested in the Time portion. How do I make the PropertyGrid allow
editing the time only? Just the hours and minutes, preferably?
Thanks
--
Chris
dunawayc[AT]sbcglobal_lunchmeat_[DOT]net
To send me an ... more >>
Palette Quantization without unsafe code
Posted by MBaskey2002 NO[at]SPAM yahoo.co.uk at 8/10/2004 9:38:24 AM
I have seen
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q319061
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/colorquant.asp
Is there anyway to do this without unsafe code???
Thanks,
Matt... more >>
Grainy colors
Posted by MBaskey2002 NO[at]SPAM yahoo.co.uk at 8/10/2004 6:32:17 AM
Hello,
I am drawing pie charts in gif format an when I use the following
colors they always appear grainy....
System.Drawing.Color.FromArgb(173, 216, 230),
System.Drawing.Color.FromArgb(0, 128, 0),
System.Drawing.Color.FromArgb(250, 250, 210),
System.Drawing.Color.FromArgb(255, 0, 0)
b... more >>
GraphicsPath.AddCurve() rendering strangely
Posted by jrmorgan75 NO[at]SPAM yahoo.com at 8/9/2004 3:27:32 PM
Hello all,
In the course of implementing a curve drawing tool, I came across
some GDI+ rasterization that I can't explain. Basically, what
happens is that for some sets of points that make up a curve
(cardinal spline), one or more ends are not drawn the way I
expect. Specifically, it appears ... more >>
what's wrong with my code(create multipage tiff file)
Posted by myhyli at 8/9/2004 10:14:03 AM
I try to convert a animation-gif file to
multipage tiff file.
my code:
<%@ page language="JScript" Debug="true"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ import namespace="System.Runtime... more >>
Need to paint transparent pixels in Resource Editor
Posted by Dean Slindee at 8/8/2004 12:05:59 PM
I would like to alter an image so that the pixels bordering subject matter
of the image are transparent. I can start with the image in .gif, .bmp, or
..png format. How can I convert the pixels bordering the image's subject
matter from white to transparent? Preferably in Resource Editor.
Tha... more >>
GetHBITMAP
Posted by cwineman at 8/6/2004 12:05:14 PM
I'm trying to use the GetHBITMAP method. The image I save for bitmap2 is
black instead of containing the data from the original image. I'm not sure
what I am doing wrong. The first bitmap saved looks correct. But I think the
hBitmap that I get is missing data or something. Like maybe I need to pa... more >>
System.InvalidOperationException: Failed to load ImageList
Posted by Jose M. Aragon at 8/5/2004 11:56:17 AM
I get the following exception when I try to run a c# winform app that
includes an imagelist:
An unhandled exception of type 'System.Reflection.TargetInvocationException'
occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an
invocation.
Unhandled... more >>
Create CMYK image on web
Posted by Lau Lei Cheong at 8/4/2004 7:31:35 PM
Hello,
I'm writing a web application for people to create a graphics and then
sent to database for mass printing. For this reason, the image will be at
best produced in CMYK color so that there will be little color difference.
I have no problem to produce the graphics in RGB TIFF for... more >>
Drawing an image with a variable opacity
Posted by Phil Jones at 8/4/2004 4:50:24 PM
Is there a way to draw an Image, and apply an opacity (alpha level) to the
entire image?
That would be really really useful (especially for making things disabled,
without having to produce secondary versions of each image).
Many thanks!
===
Phil Cockfield
(Auckland | Aotearoa)
... more >>
Draw formatted text
Posted by Ken Beauchesne at 8/4/2004 2:24:09 PM
I have floating point var that I want to display in a 3.3 format
if the Value is 20.0 and I use the Var.ToString();
the result is just 20, can someone point out the format string
that is necessary to produce 20.000
Thanks
Ken Beauchesne
... more >>
how to increase the quality of jpeg file?
Posted by myhyli at 8/4/2004 1:12:58 PM
how to increase the quality of jpeg file?
... more >>
Re: capturing image on webcam using vb.net
Posted by Julius Macala via .NET 247 at 8/4/2004 5:51:07 AM
(Type your message here)
can anyone help me on how to program visual basic=2Enet to control=
the webcam to take pictures and save them on a specified=
directory=2E pls, anyone, i really need ur help=2E i had to finish=
my thesis by this month=2E any help will be appreciated but pls do=
prov... more >>
How to create multiple frames tiff image from metafiles
Posted by gayathri gopinath via .NET 247 at 8/4/2004 4:48:37 AM
(Type your message here)
--------------------------------
From: gayathri gopinath
I am having several metafiles.
Can i use these metafiles to create multi frames tiff image.
If so, how can i do it?
I have done multi frames metafiles from gif,bmp...
But when i create multi framed tiff ... more >>
|