all groups > dotnet drawing api > july 2004
Filter by week: 1 2 3 4 5
OnPaint not working
Posted by Ken Beauchesne at 7/30/2004 3:00:40 PM
I am trying to create a progress bar control, what is happening
is the OnPaint is never accessed, I have tried the Invalidate, refresh
Update etc.. but nothing fires the onpaint event. Anyone
have a suggestion ?
Thanks
Ken Beauchesne
private void button4_Click(object sender, System... more >>
GDI+ device space size
Posted by kevinniu at 7/30/2004 11:12:18 AM
Hi Everyone,
How big is the device space for a GDI+.
For example, if g is a graphics object with no transform,
the following will throw a overfloat exception.
g.DrawLine(0,0,1000000000,1000000000);
I know in GDi it is 2^27, how about GDI+?
thanks
... more >>
backgroundimage on custom control
Posted by stewartmclean NO[at]SPAM supanet.com at 7/30/2004 8:35:12 AM
Hi,
Im puzzled about something. I have my own control which I have derived
from Panel. In the designer, I get (of course), all of the properties
of Panel. I have the BackgroundImage set to a bitmap.
Why, if I override the OnPaint method and dont call the base
implementation, does the backgr... more >>
image graphics drawing confusion
Posted by cwineman at 7/29/2004 4:22:11 PM
Below I list two methods that are part of my application. I don't understand
why, in the AddEyeMarkers() method, both versions of the newImage object
that I am saving don't contain ellipses that I have drawn using the
Graphics.FromImage( newImage ) object.
I expected newImage1.jpg to be the sa... more >>
Tiling an image starting at a certain Y position
Posted by Phil Jones at 7/29/2004 11:24:26 AM
I'm wanting to draw an image (that is 10 x 15 pixels) and tile it
horiztonally accross the width of my control (say 250 pixels wide).
I'm using the TextureBrush (although I'm not sure if I should be) with a
wrap-mode set as Tile. My problem is that I want to position it 10 pixels
down (Y), an... more >>
DrawString and underling blanks
Posted by Michael at 7/28/2004 1:38:11 PM
When I use the DrawString method to get an underlined blank space, I can only do so if there are characters to be drawn on both sides of the blank. The following codes gives 3 examples of what I want to be able to do, but only the first one works as desired.
How can I get examples 2 and 3 to have... more >>
Update on DrawImage speeds for pixel formats
Posted by Steve McLellan at 7/28/2004 12:56:03 PM
Hi,
For anyone interested, got some timings on copies using different pixel =
formats, and the results are (if I've got my methodology right) =
surprising. Code below.
It loads a file from disk, converts it to the image format specified by =
copyFrom and then copies a little bit of it a hundr... more >>
Chart Display
Posted by Amar at 7/28/2004 11:34:33 AM
Hi,
I would like to know is it possible to display an organization chart in
ASP.NET. I have a xml file which contains all the hierarchy details. Please
respond to me if there is any software tool available or readily available
tool to display this or should we use System.drawing namespace... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Tooltip when over a specific location over an image
Posted by mphanke at 7/28/2004 11:09:01 AM
Hi,
I would like to place an Icon on an Image. If the mouse is over this
Icon, I want to display the associated text in a tooltip.
How would I do this? Any ideas? My last request wasn't answered so I
give it a second try.
Best regards,
Martin... more >>
How to get an Image into hMemDC
Posted by Joe Buchmann at 7/28/2004 7:38:02 AM
Does anyone know how I can take an image opened in a .NET
Picturebox (or in an Image or Bitmap object) to hMemDC so
that I can deal with that image with regular API
functions. Any help is much appreciated.
Joe Buchmann... more >>
Visio like drawing
Posted by sivaraj MCP at 7/27/2004 9:41:05 PM
Hi all
You might have heard that Microsoft has published XML Schema for Visio Shapes.I am developing a small app which read from this XML and draw shapes using GDI+.But i am stuck with ellipitical arc .The XML Containes Following data
1. two end points of the arc - ( X1,Y1),(X2,Y2)
2. on... more >>
How to make icon look nice
Posted by Sean at 7/27/2004 1:54:23 PM
Hi all,
I have a windows application that has icons on the tab
pages, however, the icons are not clear and vivid. In
other words, the icons look horrible. It has blurry
blue/white border. The icons are in .ico type with 16X16
resolution. I have tried to resize the imageindex to 16X16
bu... more >>
Problem with showing image in larger rectangle
Posted by Ming at 7/26/2004 11:43:32 AM
Hi, all
When I try to paint an image in a larger rectangle (i.e., zoom-in) with
DrawImage method of Graphics class, I found that the image looks like it was
blurred. In most image processing software, such as PhotoShop, PaintShop,
pixels in a magnified image will be shown as rectangles filled ... more >>
Confused about Pen Width
Posted by Keith Rebello at 7/26/2004 8:34:19 AM
What exactly is the pen width? One of the Pen constructors takes a "single"
value for the width. That means I can set a pen width of 0.25 and a thicker
width of 0.5. How is this related to the pixel width on the screen?
I'm running into a problem when I use a Picture Box to show two differen... more >>
Any known issues with Regions that might cause an app to drag slowly?
Posted by Eddie Berman at 7/25/2004 11:57:31 PM
I'm trying to diagnose a problem that occurs more easily on certain machines
than others, and after some experimenting I'm suspecting that certain video
drivers may have difficulty with Regions.
Our app is skinned, with rounded edges (via regions) on the app itself and
most of the buttons. Each ... more >>
Icon for Tab Pages
Posted by Sean at 7/24/2004 7:46:20 PM
Hi all,
I have few tab pages on my application and I need the icon
for the tab pages to be in the middle since the default
has the icon being more towards the left.
Any suggestion would be greatly appreciated.
Thank you in advance.
regards,
Sean... more >>
Invalidate won't fire OnPaint??
Posted by kjon at 7/24/2004 1:45:51 PM
Hi, I have a control which is inherited from user control. In my control,
there is a public sub method that will do something and then call the
invalidate() inside that method.
But unfortunately, I find that even if I have the invalidate() inside the
method, OnPaint is not called. But if I put... more >>
File locks in Image.FromFile
Posted by Rich at 7/23/2004 11:06:02 AM
I'm using the Image.FromFile method repeatedly in an application where users need to delete, rename, and move files from folder-to-folder by point-and-click.
According to the Visual Studio Doc., the file an image is obtained from remains reserved until such time as the image object is Disposed of... more >>
replacing colors in images
Posted by Leif Högberg at 7/22/2004 5:43:04 PM
Hello,
I'd like to replace a color in an image but I have no clue how I'd go about
doing this.
I've tried changing the palette color but it didn't work, or I did something
wrong.
The image in question is in index colors and is loaded into an ImageList.
Could someone point me in the right d... more >>
Rendering Graphics and the PrintPreviewDialog
Posted by lori.pearsall7 NO[at]SPAM gte.net at 7/22/2004 4:19:41 PM
I'm at the point where I am successfully rendering graphics to the
screen and also to the PrintPreviewDialog (sending the appropriate
Graphics object to a Draw routine). This all works correctly until I
do a Print Preview and THEN maximize the Print Preview dialog. The
display draws EXTREMELY sl... more >>
Simple DrawString Question
Posted by Keith Rebello at 7/22/2004 1:13:54 PM
How does one ensure that text drawn on a Graphics object is always the same
size (font height) irrespective of the Graphics Transformation? i.e. If I
specify a 12 point font, I want it to appear to be 12 points in height even
if I re-scale the Graphics Transform.
... more >>
How to convert image jpeg to tif group 4
Posted by Xavier Lelievre at 7/22/2004 10:01:05 AM
I have an image with PixelFormat.Format24bppRgb
I want to convert in tif black & white.
I know to use encoder image/tiff and CompressionCCITT4 parameter to save in
tif but I don't know to transform PixelFormat.Format24bppRgb to bitonal
before using image.Save
Thank's for your help
... more >>
Graphics.DrawImage, and strange alpha channel issue
Posted by svendtofte NO[at]SPAM svendtofte.com at 7/21/2004 6:41:45 PM
Hey,
I've been trying to mess around with the alpha channels in PNGs, and
I've run over a rather strange (IMO) "feature". I want to know, how I
can step around this.
I'm removing the alpha channel, found in the PNG image, but depending
on what DrawImage method I use, I get differing behavio... more >>
Graphics.DrawImage bug?
Posted by Steve McLellan at 7/21/2004 6:00:12 PM
Hi,
Is there a known problem using DrawImage to scale an image? We're using it
to plonk little tiles down (100 X 100) pixels and especially at non-integer
scaling, we're experiencing some horrible tearing and missing pixels. It
especially seems to be a problem above 1000%, and more so towards ... more >>
CMYK images
Posted by Steve McLellan at 7/21/2004 1:38:55 PM
Hi,
This might be a stupid question, but is there a simple way to tell what kind
of colour space image a System.Drawing.Image is holding? PixelFormat doesn't
seem to do it - its options only include various RGB values and then some
other vague names.
Thanks,
Steve
... more >>
XOR Pen mode ?
Posted by jpcomptour at 7/21/2004 10:38:23 AM
Hi All,
I would like to draw a line which should display then disappear on a
timer.
Should I use an XOR pen mode ? or other ?
On unix X Window, I used GxXor, but on DotNET I can't find anything
equivalent.
... more >>
Region IsVisible bug?
Posted by bpietsch NO[at]SPAM alumni.calpoly.edu at 7/20/2004 10:57:31 PM
Can anyone confirm whether this is a bug in the IsVisible method if
the Region class?
Region r = new Region();
r.MakeEmpty();
r.Union(new Rectangle(new Point(0, 0), new Size(160, 24)));
r.Union(new Rectangle(new Point(0, 48), new Size(160, 24)));
bool a = r.IsVisible(new Rectangle(new Po... more >>
CPU jumps to 100% - I overrided the OnPaint method of a Control to display an Image
Posted by babylon at 7/20/2004 2:44:24 PM
I tried to display a 2M jpg, I found that the OnPaint method is keeping
calling continuously and the page faults count of the application keep
increasing...
I just used
e.Graphic.DrawImage(this.Image, this.location.X, this.location.Y,
this.width, this.height);
to paint the image
what's wron... more >>
Printing of shapes in GDI+
Posted by Pravin at 7/20/2004 10:39:56 AM
I am drawing some shapes on the scrollable panel using GDI+. The panel may
grow vertically or horizontally according to the shape positions. I have to
print these drawings on the panel.
I tried capturing the screen shot of the panel but it working only for the
visible area (won't cover the scr... more >>
AAARRRRGGGGGHHHHH!!!! I'm pulling my hair out here. OpenType fonts aren't working!
Posted by Tim Greenwood at 7/20/2004 8:37:17 AM
We've added the opentype font 'Myriad' to our windows install. There are
several variations. These fonts do not show up in the
System.Drawing.FontFamily.Families array. I wrote a quick Visual C++ app to
use the EnumFontFamilies() WINAPI to get a list of fonts and they show up.
There's got to ... more >>
Drawing reversed text with GDI+
Posted by Steve Austin at 7/19/2004 1:59:24 PM
I'm writing an application which amongst other things generates 2D charts:
what I'd like to be able to do is provide feedback to the user of the
coordinate position when the mouse is moved within the graph region. The
way I've done it using interop is IMO messy (and GDI leak potential is very... more >>
Graphics.Clip region always infinite when painting
Posted by n8allan NO[at]SPAM yahoo.com at 7/19/2004 10:27:06 AM
Regardless of how a control is invalidated, the "Clip" region of the
Graphics object within the PaintEventArgs always seems to be infinite.
This is counter to the Win32 behavior which would ensure that the
clipping region of the HDC returned by BeginPaint would contain the
former update region.... more >>
Can't StretchBlt an image loaded from my hard drive
Posted by D. Yates at 7/19/2004 10:05:53 AM
I can't seem to figure out why I can't StretchBlt an image that I have
loaded from my hard drive. There are two button events below. The first
button event, btnFormStretch_Click, works fine, but the second one,
btnStretch_Click, does not. The only difference seems to be the way that I
get th... more >>
GDI+ "drawing areas"
Posted by PhilipZ at 7/18/2004 10:29:44 PM
Hi there!
I am looking for a possibility to draw e.g. a circle or rectangle with some
text in it (VB.NET and GDI+). The text will be moving, but must never exceed
the edges of the circle/rectangle. So the text should be "cut off" at the
edges of the surrounding circle/rectangle.
Can anyone ... more >>
mapping Font Name to windows/fonts file
Posted by robert linder at 7/17/2004 10:17:28 PM
Hi,
I am trying to map a font name to the filename in windows/fonts
directory. This needs to be in a CSharp program.
The user can change the font using FontDialog or a editing a dataset.
The font names currently needing mapping are:
arial
arial black
microsoft sans serif
cosmosbq-ligh... more >>
GetDC from Bitmap via API (for double buffered controls under CF)
Posted by Benjamin Lukner at 7/16/2004 5:34:32 PM
Hi!
When using the Full Framework, it's quite easy to get the handle of a
bitmap object:
Private _bmp As System.Drawing.Bitmap
Private _graphics As System.Drawing.Graphics
_bmp = New System.Drawing.Bitmap(100, 100)
_graphics = Graphics.FromImage(_bmp)
Dim hDC As IntPtr
hDC = _grap... more >>
How to change Draw3DRect in DotNet
Posted by Jessie Niu at 7/16/2004 12:13:33 PM
Hi,
anyone know how to use donet to do the things Draw3DRect?
thanks
Jessie
... more >>
Pen problem (bug?) when using ScaleTransform.
Posted by Peter Erikson at 7/16/2004 6:28:27 AM
Hi,
I have a problem drawing lines (with the Pen object) on a derived Panel when I scale the graphics object in OnPaint. It only happens when i scale down (or zoom out).
e.Graphics.ScaleTranstorm(0.5F, 0.5F); // for example
The problem is that sometimes when a line is drawn on or very close... more >>
How to draw string with postscript font instead of true type font?
Posted by Kelly Chen at 7/15/2004 11:07:17 PM
Hi, I couldn't draw text with postscript font using GDI+. Although I could
use GDI to set the postscript font however when I began to draw text with
drawstring() function, it complained that the font needed to be true type
font. Can anyone help me. Is there a software that convert postscript t... more >>
Elliptical Arc
Posted by Andrew Craven at 7/15/2004 9:18:51 PM
Hi all,
Does anyone have a nice way of drawing elliptical arcs on a
GraphicsPath? That is, an arc between two points, given vertical and
horizontal radii, and a 'large angle flag' and 'sweep flag', such as in SVG.
I'm really asking if anyone has an idea of how to position the control
poi... more >>
System.Drawing.Graphics.DrawImage performance
Posted by Steve McLellan at 7/15/2004 7:52:15 PM
Hi,
Does anyone have any performance info on the above function?
Specifically I'm interested in the relative performance of, say, copying an
image into another in tiles versus copying in one go.
A test I just ran came up with the following:
Filling a 1000 X 1000 destination from the sam... more >>
SelectActiveFrame
Posted by Bob Powell [MVP] at 7/15/2004 2:58:22 PM
I know I don't often ask questions on this forum :-)) but...
Has anyone *ever* managed to make Image.SelectActiveFrame work with
FrameDimension.Page??
I have created scads of multi-page TIFF images but only ever read them with
the MS Fax Viewer application. I find that when I load them in an... more >>
No DrawFocusRect method?
Posted by Jens Weiermann at 7/15/2004 2:10:42 PM
Hi guys,
I'm looking for the DrawFocusRect() equivalent in .NET if there is such a
thing...
Thanks!
Jens... more >>
48 bit TIFF saved in Photoshop
Posted by Steve McLellan at 7/15/2004 12:34:07 PM
Hi,
We're writing an application that has to be able to load 24 and 48 bit TIFF
files. Image.FromFile seems to be fine with the stuff we've thrown at it,
except that 48bit TIFF files saved in Adobe's Photoshop are a factor of 8
too dark. We know from experience with Adobe's SDK that they repre... more >>
Detect a color device
Posted by Benjamin Lukner at 7/15/2004 12:05:49 PM
Hi!
I just became aware that on my b/w Pocket PC device all colors are
transformed to gray if I use e.g. Drawing.Graphics.FillRectangle.
I thought they won't be transformed before the bitmap is written on the
display.
Is this behaviour a feature of .Net (Compact Framework) or depends it o... more >>
determine mulitline text size
Posted by SteveB at 7/15/2004 4:09:02 AM
Hi,
Is it possible to set the width for a piece of multiline text and then to determine it's height?
I would like to display some text in a label of a fixed width and set the label height to display the text fully without wasting anyspace.
Is there an easy way to do this?
Many thanks in ... more >>
Creating snapshots of System.Windows.Forms.Controls that are not visible on the screen
Posted by Christian Nein at 7/14/2004 7:18:59 PM
Hi,
I am still searching for a way to create snapshots from a
System.Windows.Forms.Control without copying the picture information of the
screen, because the snapshot shall also be taken from a control that is not
visible on
the screen.
Now I found some COM-example realizing this task by u... more >>
For Bob Powell: The code for storing of multipage TIFFs misses some tags
Posted by as NO[at]SPAM infoman.de at 7/14/2004 1:15:10 PM
Hello Bob,
after I convert an TIFF file, obtained from Windows 2000 Fax Service,
the new file has no tag 266 any more and has the tag 254 with value 0
instead of 2. Do you know a way
- how can I set some tag like 254
- how can I add some tag, that the original image doesn't have?
Regards,
... more >>
Modifying Images. ASP.NET and GDI+
Posted by Ryan Ternier at 7/14/2004 11:52:56 AM
Heya!
To start out with, I know nothing about GDI+, except that it has a + in it.
I'm working on an image editor for an online application coded in VB
ASP.NET.
The purpose is to be able to upload a scanned image (document) to the
server, and then have users highlight / black out sections o... more >>
how to create eps image with c#
Posted by Phong Pham at 7/14/2004 11:33:31 AM
Hi everyone! Can anyone show me or point me in the right direction on how to
create an EPS image file in C#?
I've tried creating bitmaps and jpeg files but I need to create an image
file in an EPS file format for printing graphs.
Thanks,
Phong
... more >>
|