all groups > dotnet drawing api > july 2005
Filter by week: 1 2 3 4 5
What has Happened to the Graphics Class?
Posted by Joseph Geretz at 7/31/2005 11:07:35 PM
I'm using C# documentation from 2001, Based on Framework 1.0. At the same
time, I'm using Visual Studio 2005 Beta2, Framework 2.0.
I'm trying to use the Graphics class, but I don't see half the methods
listed in the documentation:
Graphics.FromHwnd - Gone (OK, I've gotten around this by us... more >>
Saving BitMap as Icon
Posted by Dennis at 7/31/2005 7:31:01 AM
I have a bitmap that I've defined and drawn on and want to save it to a
bitmap as follows:
Dim bmp As Bitmap
Dim g As Graphics
Dim c As Color = Color.FromArgb(255, 255, 255, 255) 'use for transparency
bmp2 = New Bitmap(24, 24, PixelFormat.Format32bppPArgb)
g = Graphics.FromImage(bmp)
... more >>
Pen Width less than one pixel.
Posted by Bhavin at 7/28/2005 9:18:10 PM
Hi,
Excuse me if this is too naive a question. Though i have been using
System.Drawing since some time now, i admit i donot know a LOT about it yet.
Is a pen-width of lesser than one pixel supported at all?
If i draw two lines with a pen of 0.5 pixels, alongside each other, is there
anywa... more >>
DrawString() units of measurment
Posted by Jay at 7/28/2005 11:23:05 AM
System.Drawing.Graphics.DrawString(String, Font, Brush, int, int)
what are the units of measurments for the x and y coordinate arguments?... more >>
Given a point[] for a ploygon draw it with rounded corners
Posted by Shiv Kumar at 7/28/2005 10:47:13 AM
I need to be able to draw a polygon with rounded corners. That is given
(say) an array of points that form the polygon, I'd like to draw it such
that the corners are rounded (the radius needs to be configurable).
How would I go about doing this?
--
Shiv Kumar (THF Team)
http://www.dynamic... more >>
display an image with BitBlt (in Paint-method)
Posted by DraguVaso at 7/28/2005 10:13:49 AM
Hi,
In the override of the Paint-method of a DataGridTextBoxColumn I want to
show an image with BitBlt, to see what I can gain there on performance.
The problem is: It doesn't show me the image in the DataGrid-Cell's, but a
black background...
Does anybody has any idea what I am doing wrong... more >>
Writing Text on an Image.
Posted by sameer at 7/28/2005 7:16:02 AM
Hi,
My ASP.net applicatian uploads images up to my webserver, and in the process
compressess it and decreases the size as well. Now there is one other feature
that i want to include in it as well, the bottom part of the iamge shold have
my company name on it in kind of like transparent ( but ... more >>
Printing a PDF & Excel from C# application
Posted by varada.k NO[at]SPAM gmail.com at 7/28/2005 3:56:33 AM
Hi All,
I have been trying to get a code snippet for printing a PDF & EXCEL
file from a C# windows application. These documents are generated from
Reporting Services. Though i can directly render the page and print it,
i am facing some problem. so i am trying out to print after the report
is ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Draw an Image on my Form
Posted by DraguVaso at 7/28/2005 12:00:00 AM
Hi,
I have an inherited DataGrid, that does lots of extra stuff. For exemple
drawing a backgroundimage in every cell. The problem is that it's taking too
much time (using gdi+), so I want to do it using DirectX. I downloaded
already the DSK etc, but I can't find how I need to draw an image on ... more >>
How to get Image Dimensions without having to load the image into memory.
Posted by RedEye at 7/27/2005 4:57:17 PM
Greetings,
I want to write an application that will look at an image folder and create
a spreadsheet that holds image information like width, height, resolution,
format and image name.
How can I get this information with having to load the image into memory.
The images I am working with ... more >>
How to use LoadPicture() in VB.NET ?
Posted by Dushyant at 7/27/2005 2:25:02 AM
Hi everyone,
I am converting one code from VB to VB.NET. I dont know how to use method
LoadPicture() in VB.NET ?
All the responses are welcome.
Regards,... more >>
How to draw with a PEN ?? Please help
Posted by expertware NO[at]SPAM libero.it at 7/25/2005 7:45:48 AM
I need to draw with a pen using a semitransparent
color as in the following example:
Dim Color As Color = Color.FromArgb(100, Color.Blue)
Dim pen As New Pen(Color, 1)
Graphics.DrawPolygon(Pen, Points)
however I get a solid line (the alpha channel is ignored by the
pen). Can anyone sugges... more >>
Manual control over word wrapping?
Posted by Jon Shemitz at 7/23/2005 2:54:15 PM
Graphics.DrawString will do word wrap, if you pass it a rectangle
instead of a point. But, so far as I can see, it will only wrap on
whitespace following non-whitespace.
Is there any way to supply a word-break handler, so that DrawString
can wrap on hyphens (like in "word-break") or dots (like... more >>
How to move parts of an image?
Posted by Daniel Walzenbach at 7/22/2005 7:02:04 AM
Hello,
I need to rearrange parts of a picture on the very same picture. Imagine for
example a picture of size 800x600 px. What I’d now like to do is to take a
rectangle (100, 100, 150, 150) and move this to point(200, 200).
Does anybody know how this can be done?
Thank you!
Dani... more >>
List of printers on server
Posted by Boni at 7/22/2005 6:15:03 AM
I saw that I can read the list of the installed printers on my computer
PrinterSettings.InstalledPrinters;
But I wont read the list of the shared printers installed on a domain server.
//myserver/printers
or simply
//myserver
It's possible?
Thank's
Boni... more >>
create bitmap from pixel array data v2
Posted by Aykut at 7/22/2005 12:00:00 AM
Hi
I ve a pixel array data which has following properties:
512X512, grayscale
16bits per pixel is allocated but 12 bits used for each pixel.
I want to display this as a bitmap.How can I do this?
morten tried to help about this some topics before.but I m realizing the
unused 4 bits by now.... more >>
no Hdc.. yikes!
Posted by nee at 7/21/2005 7:37:07 AM
Ok so here's the problem:
Our company is slowly but surely deciding that vb.net is much better
than vb6.. at last! Anyway, we have a dll which was made by a partner
company that contains a function that requires a picturebox hdc.
In vb.net the hdc no longer exists and hence I need to find a ... more >>
custom line and gdi+.....
Posted by Scylla at 7/21/2005 12:00:00 AM
Hello
I begin with gdi+ and i would like draw a line (curved or not). Th
problem
is for the line "style" : for exemple, the style of line is a lin
with half
round on it, or the line is composed by * (i don't know if i'm clear
sorry
for my bad english).
How can i do that in vb6 please?... more >>
Icon transparency not efective
Posted by **Developer** at 7/20/2005 5:09:48 PM
In one part of a program I use ExtractIconEx and DrawIconEx.
The result is that parts of the icon display the background color - I assume
those parts are set to be transparent.
In another part I do:
Dim lIconHandle As IntPtr
Dim lImg As Image
lIconHandle = Shell.ExtractIcon(Me.Handle,... more >>
Are there drawImage scaling mode options?
Posted by **Developer** at 7/20/2005 2:22:32 PM
If I use the a graphic object's DrawImage method I can draw, for example, a
16x16 Icon as large as the screen.
If I were enlarging a photo I might want what I get from DrawImage but for
an Icon I'd like to see the pixels (enlarged of course.) That is, I'd like
to see the enlarged image ma... more >>
C# Graphics to MS Word
Posted by Harald at 7/20/2005 8:48:06 AM
In a C# application I use a Graphics object to plot data on the screen. How
can I copy this graph to the clipboard and insert it in a MS Word document?
Harald... more >>
Going on vacation.
Posted by Bob Powell [MVP] at 7/20/2005 12:00:00 AM
Hi folks.
I'm going on vacation 'till August 6th. I might drop in here if I find a
cybercafe anywhere but I'm hopefully going to be too busy having fun to
worry too much about programming ;-)
TTFN...
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
htt... more >>
Drawing Sheared fonts
Posted by Publicjoe at 7/20/2005 12:00:00 AM
Hi everyone, I am working on a simple graphics text app, code below.
Hopefully Bob will be able to answer this one.
I cannot work out the maths to get the sheared text to start at the same
position (bottom left) as the upright text appears. You may need to play
with fonts and words to see wh... more >>
GDI+ and RTL
Posted by Ananth at 7/19/2005 11:55:02 PM
Dear Group,
Are there any known issues in using the GDI+ classes/methods such as
SolidBrush, Pen, DrawLine, DrawRectangle or FillRectangle - when the control
is painted in a RTL layout? Because, we are encountering unexpected
behaviours
whenever we switch the layout of our application (to... more >>
Saving BitMap with tranparency Color to a File
Posted by Dennis at 7/19/2005 4:44:03 PM
I have a bitmap that has a transparent color of Color.Transparent. If I save
it to a file using the Save method directly like;
mybitmap.Save("c:\mybitmap.bmp")
It is saved with the transparentcy preserved.
If I save it using a file stream as follows;
mystream = New IO.FileStream("c:\mybitma... more >>
Region.IsVisible - rounding error?
Posted by matt tag at 7/18/2005 6:41:25 PM
I posted this same code long ago and nobody had an answer. I'll try
again.
Does Region.IsVisible have rounding problems? The code below returns
True for a point inside a RectangleF, and False for the same point
inside a Region created from the same RectangleF.
thanks,
matt tag
D... more >>
PrintPreviewDialog 2.0 has some slight error
Posted by ADEBISI Foluso at 7/18/2005 6:32:05 PM
Hi,
When I call ShowDialog() method of the PrintPreviewDialog, in .Net 2.0, the
first time, all its toolbar buttons are present. Closing this window using
the Close buton on the toolbar and then recalling ShowDialog() on the
PrintPreviewDialog object, i can't see all my toolbars again!
... more >>
ColorMatrix to set alpha for particular rgb?
Posted by Jon Shemitz at 7/18/2005 4:29:57 PM
Pardon my rustiness, but is it possible to construct a ColorMatrix
that would set alpha for points that match a particular RGB, while
leaving alpha untouched for all other pixels?
For example, set RGB 0x123456 to 0x20, and then set alpha for RGB
0x654321 to 0x10.
--
www.midnightbeach.... more >>
Detecting jpg properties
Posted by Gary Nastrasio at 7/18/2005 1:43:01 PM
How can I detect if a .jpg is progressive or not? I'm using the Bitmap
..NET class. I see it has a PropertyItem array that stores metadata,
which I'm guessing will contain that information, but I have no clue how
to extract it.
Thanks,
Gary... more >>
Graphics.DrawImage consuming more memory ???
Posted by Aravind at 7/18/2005 12:26:19 PM
I am trying to create a image object out of a bitmap file like
Image img = new Bitmap(@"c-\CurDisplayImage.bmp"); ,I found the memory
of the process is increased twice as the bitmap size , for example if I
load a 50MB bitmap the memory is increased by 100MB ,
Also when I draw the image with e.Gr... more >>
DrawImage with High DPI Still Pixelated?
Posted by Craig at 7/18/2005 6:30:01 AM
Hi All,
I get a lot of pixelation (bluriness) when I draw an image into a graphics
object that is passed to the Paint event handler when I perform a print. The
image that I am using has a DPI of 600x600 (same as the printer) with some
text. When it prints the image, the text is blury. No... more >>
create image from pixel byte array
Posted by Aykut at 7/18/2005 12:00:00 AM
Hi,
I have a byte array of pixels. I know the size of image (512X512) and
pixelformat.
How can I create a bitmap image from this byte array?
I know it will be with bitmapdata and lockbits.
I need some sample code since I do know about details.
Bitmap bmp1=new
Bitmap(512,512,System.Drawing... more >>
Convert Icon to BitMap
Posted by Dennis at 7/17/2005 6:49:03 PM
I can convert an Icon to a BitMap but I can't seem to get the Icon
Transparent color in order to make the BitMap same color transparent. Would
appreciate any Help.
--
Dennis in Houston... more >>
Drawing Icons and BitMaps
Posted by Dennis at 7/17/2005 6:44:33 PM
I have a user control that I paint myself. I have a bitmap in the control
representing the control surface which I draw on then in the control paint
event, I use BitBlt to copy this background bitmap to the e.Graphics object
passed in the e.System.Windows.Forms.PaintEventArgs to the Paint Eve... more >>
DrawCircle with Pen that erase the Pixels inside
Posted by Tavarua2K at 7/17/2005 5:19:13 PM
How can i do to make a Pen with Null Color??
i want to use the drawCircle method to erase a circle in a bitmap...
please i need help!!
... more >>
Creating a shadow from a bitmap with transparency
Posted by William Sullivan at 7/15/2005 1:45:03 PM
Having a hard time with this. Essentially, I want to set all visible pixels
in the bitmap to black and then set the transparency to about .25. I can do
the transparency with a simple ColorMatrix. But I can't seem to figure out
how to apply a ColorMatrix to the image so that only the visible... more >>
scale bitmap image without interpolcation
Posted by LiPing at 7/14/2005 6:28:03 PM
Hi,
In a Image Processing project, I need to scale the bitmap image without
interpolation, just like Paint does when zooming. For example, use Paint to
create a bitmap with only one black pixel.
Then select the magnifer to zoom the dot with x8. You will see one bigger
black dot,
which is ... more >>
Converting a JPG to TIF in C#
Posted by Joe Ross at 7/14/2005 3:00:04 PM
I needed to create a batch process to convert a large number of JPGs to TIF
CCIT4 format. I'm sure there are libraries out there to do this, but I
couldn't find any that were free. I also found lots of source code that got
me on the right track but never seemed to solve my problem completely... more >>
Generic Error in GDI+ related to DrawLine
Posted by Todd McDermid at 7/14/2005 2:23:01 PM
Good afternoon, ladies & gents.
I have an intermittent error occurring on my Windows Form, on which I'm
attempting to manually draw a "legend" of colors that applies to background
and foreground colors on a grid elsewhere on the form. The error is not
intentionally repeatable, and seems to... more >>
A moving bitmap - or what replaces ScrollDC?
Posted by Allan Hansen at 7/14/2005 7:11:02 AM
I'd to draw a "moving" bitmap in a window, essentially moving the bimap one
pixel to the left and a new vertical line all the time.
In GDI I accomplished this by doublebuffering and using the win32 call
ScrollDC. A rather efficient solution that did not require me to copy/clone
by bitmap a... more >>
ColorMatrix class
Posted by Jon Shemitz at 7/13/2005 9:09:18 PM
Why is it five by five, and not four by four? What is the w (omega?)
channel for?
--
www.midnightbeach.com... more >>
state transition diagram
Posted by PromisedOyster at 7/13/2005 7:10:05 PM
I want to build and show a state transition diagram within our
application. This will create/use an XML containing the code/
This diagram shuld be able to show start/end state nodes, activity
nodes, decision points etc. It should also have the ability to double
click on nodes to show more deta... more >>
Decolor
Posted by Jon Shemitz at 7/12/2005 10:52:25 PM
Just for the heck of it, a method that will decolor a bitmap,
ala XP shutdown.
/// <summary>
/// Apply a ColorMatrix to the Original to strip out the color
/// </summary>
/// <param name="Original">Bitmap to decolor</param>
/// <param name="Graylevel">0 is full color, 1 is full gray</param>... more >>
Text gets offset on some printer???
Posted by Sergey at 7/12/2005 12:40:08 PM
Hi,
I'm having a strange problem. For some reason .NET Framework on some
printers prints draws text offset the graphical elements. I'm trying to draw
a table with some text and the same code produces different result on
different printers.
Bellow is C# example I made to test it. The task... more >>
Drawing a "rounded" polygon
Posted by Shiv Kumar at 7/12/2005 11:29:40 AM
I have the a point[] in order to draw a polygon, but I'd like to draw a
"rounded" edge polygon.
How would I go about doing this?
--
Shiv Kumar (THF Team)
http://www.dynamicarchitects.com
... more >>
Gif question
Posted by dee at 7/11/2005 1:24:40 PM
Hi,
I have a gif image and I would like to change the colors in it. But only the
colors that are in the image's palette are accepted. How could I change the
palette colors? What program/s can be used to do this?
Thanks for the help.
Dee
... more >>
mspaint fill option in dgi+
Posted by reg1965 at 7/9/2005 7:28:04 AM
hi all
how can i replicate mspaints fill option using gdi+. say i was to draw 3
intersecting lines to form an "A" shape and then point the fill tool into the
enclosed triangle it will fill with colour.
also if i were to draw an unclosed squiggly line and do the same thing the
background woul... more >>
Centering rotated text on an image.
Posted by Weston Weems at 7/8/2005 10:10:23 AM
Hello,
I've got a goal that I would expect to be very simple to meet. I've got a
graphics canvas which I've drawn an image onto... and then I'd like to draw
text at a -30.00 degree angle, and have that text centered on the image.
I tried drawing image, then setting rotatetransform(-30.00) ... more >>
Image.FromStream - Invalid Parameter Used
Posted by Tom John at 7/8/2005 9:43:00 AM
Hi
I am storing images in an access database, based on an MSDN article.
The code i use to store is as follows:
<code>
'Create the command object
Dim command As New OleDbCommand("ImageBlobUpdate", dataConnection)
Command.CommandType = CommandType.StoredProcedure)
'Get the byte array fr... more >>
How to Convert JPG to BMP
Posted by leonidas at 7/8/2005 6:10:03 AM
i want to convert JPG image file to BMP by using .NET Framework Class Library
(System.Drawing.Imaging)
there is a class named "ImageFormatConverter", but i couldnt find how to use
it.
could someone help me please?... more >>
|