all groups > dotnet drawing api > august 2003
Filter by week: 1 2 3 4 5
recognize image files
Posted by dotNET rookie at 8/29/2003 5:04:44 PM
Hi,
I'd like to know if there's a way to identify a file as a valid bitmap which
can be loaded with the public Bitmap(string filename) constructor.
Should I test filename's extension or is there a way to check the header ?
Maybe there's a function which gives me supported extensions so I won't... more >>
Image inclusion in projects
Posted by Justin Weinberg at 8/29/2003 12:48:45 PM
I'm releasing a tool soon that works with GDI+. One of the features is the
ability to import images and produce code. I've identified 4 ways that a
project could get at images.
1) Build action embed
2) Build action content
3) A relative path to the image from the /bin
4) An absolute pa... more >>
Drawing a proper drop-shadow?
Posted by Christopher Ambler at 8/29/2003 11:15:27 AM
I'm working on some GDI+ code to bring a JPG into a bitmap and dynamically
draw a frame and dropshadow around it.
I've got the image loaded and scaled such that I have room, and can do the
frame, but the dropshadow is, invariably, just a black bar on the right and
bottom of the image. Of cours... more >>
Simple Question
Posted by John at 8/29/2003 7:36:20 AM
Hi,
I am writing a graphing application that needs to have
multiple instances of custom graphs written vertically. I
then need a governer that can interact with all the graphs
by drawing a vertical line to line up the graph points.
My basic question is I need to draw something on top of... more >>
Setting size of New Bitmap
Posted by MW at 8/29/2003 12:51:29 AM
I need to create a fax cover page. For this I am creating a bitmap image
doing the drawing on it and then converting it to tiff format.
I am have a problem with getting the size of the image correct. I need two
sizes for starters, legal and letter. When creating new bitmaps you can set
the ... more >>
transparent pictureboxes
Posted by ultim at 8/28/2003 3:24:32 PM
hi
i want to put several pictureboxes onto each other, so i
get layers made of pictureboxes. the most part of a picbox
should be transparent, so that only the drawings occlude
the picboxes behind it, and where a picbox is transparent,
the drawings on the picboxes behind it are visible.
I... more >>
Multiple display monitors
Posted by Fred Moses at 8/28/2003 9:59:07 AM
Windows GDI has support for multiple display monitors.
Where are comparable facilities in the .NET Framework
Class Library. What are the C# bindings?... more >>
Cannot get MeasureString to return accurate value for making columns
Posted by Audrey Homer at 8/27/2003 11:19:59 AM
Hi all. I realize this MeasureString topic has been
tossed around quite a bit but I can't seem to make it work
well despite trying out all the postings. I implemented
all I tried in the little function at the end of this
posting.
I've been trying to create some text separated into
c... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Drawstring doesn't work with all printers. Any ideas?
Posted by robert NO[at]SPAM oparnica.com at 8/27/2003 10:51:36 AM
I have been doing some simple tests, based on the code given in the
MSDN example, with additions to select any of the printers available
on my machine.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDrawingPrintingPrintDocumentClassTopic.asp
Everything... more >>
Graphics.FromHwnd
Posted by Thomas Bock at 8/27/2003 1:14:58 AM
Hi NG
I get allways a OutOfMemory-Exception, when I would get a Graphics-Object,
but it could not be right. When I try with this.Handle it is all ok. When I
try with a Handle from Spy++ I get a OutOfMemory-Exception. What could be
wrong?
Thomas Bock
... more >>
VS icon editor problem
Posted by Bruce W...1 at 8/26/2003 8:07:01 PM
In Visual Studio 2003 I make a new icon file. By default it shows a 32
x 32 icon which I'm not using. So I make a new 16 x 16 icon and save
it. The 16 x 16 icon works fine.
On the next day I start up VS and go to the icon file. By default it
shows a 32 x 32 icon. But I can't figure out ho... more >>
GDI+ Acceleration
Posted by James Westgate at 8/26/2003 4:41:31 PM
Hi All,
Following on from a conversation with John from MSFT below, are there any
cards that support GDI+ acceleration? And more importantly how is this
possible?
--
Snooping around Google I found this link with a comparison table
http://www.digit-life.com/articles/triplexxabre/
Inside t... more >>
Help drawing on top of an image!
Posted by J. Ptak at 8/26/2003 4:22:26 PM
I have been struggling with this for over a week now. Here's what I need to
do:
1) Load an image into a picturebox control.
2) Draw a transparent box with a colored border on top of the image.
3) Be able to click anywhere in the image and "move" the box to the mouse
coordinates.
Step 1 is... more >>
Newbie needs help
Posted by Matt Gaines at 8/26/2003 10:18:36 AM
Hi all,
I am very new to programming and C# and had a few questions about bitmaps
and drawing them to the screen.
Question 1: When creating a Bitmap object from a file, does it keep the
file open for the life of the object or does it just store it in memory. If
it does keep the file open,... more >>
Antialiased drawing on a transparent window?
Posted by TomG at 8/26/2003 9:58:35 AM
Anyone know how to create and draw on top of a transparent window? I tried
specifying a transparent color for the form but any antialiasing blends with
the designated transparent color rather than the desktop.
I thought using NativeWindows might be the solution but I haven't been able
to find... more >>
Stopping the madness! DoubleBuffer and CreateGraphics
Posted by john NO[at]SPAM snapjax.com at 8/25/2003 11:57:51 PM
I've just spent 2 days figuring this out, so I figured I'd post this
to help anyone going through a similar issue.
My problem was that I wanted to create a control that used double
buffering to eliminate flickering when it paints itself to the host
form.
To do this, I added the following to... more >>
PrinterSettings is NOT serializable?
Posted by Koji Ishii at 8/25/2003 3:57:56 PM
Although PrinterSettings is marked as [Serializable] attribute, when I call
Serialize() of BinaryFormatter or SoapFormatter(), it raises an exception.
System.Drawing.Printing.TriState is not marked as serializable.
at
System.Runtime.Serialization.FormatterServices.InternalGetSerializableM... more >>
TIFF properties
Posted by Sankalp at 8/25/2003 3:28:11 PM
Hi,
I'd like to find out the properties of a TIFF. For example, its color(B/W,
grayscale, color etc) , its compression and resolution. Any idea on how to
go about this.
Any pointers will be helpful.
Thnaks,
Sankalp
... more >>
Clipboard method: Clipboard.GetDataObject.GetData(DataFormats.EnhancedMetafile,true); doesn't work!!!
Posted by Leo da Perdi at 8/25/2003 1:32:51 PM
There is no way to extract an EnhancedMetafile: with
object o = d.GetData(DataFormats.EnhancedMetafile);
I always obtain an object null reference to "o".
Someone knows why this appens? There is some way to bypass this problem?
Thanks in advance
... more >>
PropertyItems (Exif file format)
Posted by DeVries48 at 8/25/2003 1:11:22 PM
Hi,
I 'm trying to get the metadata from a JPG image (created by a digital
camera).
When I use 'Image.PropertyItems' I only get 2 property-items.0x5090 and
0x5091...
I know there are a lot more tags, when I look with IrFanView or with the
windows explorer under Windows XP I see there is ... more >>
.WIT files?
Posted by Alan S. at 8/23/2003 2:17:54 PM
Hello NG,
Does anyone know how to read .WIT files? Apparentley the are some sort
of thumbnail type images but I cannot find details about them anywhere.
Many thanks
Alan.
... more >>
Can I create this service?
Posted by Jeff Johnson [MVP: VB] at 8/22/2003 4:55:05 PM
I need to write a service which will monitor a database and generate an
image to be faxed to a customer. I'm generating an image because this
service won't do the faxing itself, but rather will write some information
into another table which is processed by a program that does the faxing.
This s... more >>
Create an JPG or GIF from Base64 Stream in Compact Framework
Posted by Francis Shanahan at 8/22/2003 1:06:02 PM
All,
I have written a desktop app which takes a Base64 encoded Stream and creates
an image from it.
The data in the stream represents a JPG or GIF image which is best in my
case for size (versus BMP).
The problem I'm having is that the Compact Framework doesn't support the
APIs I'm using i... more >>
Image.FromFile error
Posted by vakilzadeh NO[at]SPAM kzlabs.com at 8/21/2003 10:23:30 PM
I call this routine repeatedly:
public void LoadImage(string filename)
{
Image img=Image.FromFile(filename);
pictureBox1.Image=img;
img.Dispose();
}
if I dont call dispose it gets error when I call dispose it gets
sharing "filename" error.
Please help... more >>
using GDI+ to read EXIF data from jpeg w/o loading bitmap into memory
Posted by shahineo NO[at]SPAM hotmail.com at 8/21/2003 12:20:35 PM
Is there a way to prevent the entire jpeg from being loaded into
memory to read an EXIF value from the file? GDI+ seems to load the
whole image into memory to get this value.
here is some code snippet:
Dim s As New FileStream(p, Filemode.Open, FileAccess.Read)
Dim image As New Bitmap(s)
... more >>
Access Twain Scanner in C#
Posted by Fred at 8/21/2003 4:39:25 AM
I have created a windows application with Visual
Studio .NET 2003, using C#. It saves data to SQL2000 in 10
fields, from information taken from a Metal Manufactures
Certificate, which also has to be saved to disk from a
Twain Scanner. How can the Twain Scanner be accessed from
the Windows ... more >>
help on scroll
Posted by BestNews at 8/20/2003 5:39:37 PM
Hi,
any equivalent function for CWnd::ScrollWindow() in C# forms or .Net
warm regrads
sk
... more >>
Unhandled Exception Cured By a MessageBox
Posted by Beau at 8/20/2003 1:46:21 PM
When designing my application I encountered no problems
with my print code. I used VB.NET on an Win XP machine, I
used .NET 1.0. When the application was installed on a
Win 98 machine I received a NullPointerException error
when trying to print a PrintDocument object or preview it
with a ... more >>
Windows Service and GDI+
Posted by Chuck.Newark NO[at]SPAM NREIS.COM at 8/20/2003 4:41:41 AM
I have a windows service that is written in VB.Net. This service
needs to use funtions in GDI+. Of course I get an error since it can
not interact with the desktop.
Other post have said to allow the service to interact with the
desktop, however this service can not run as LocalSystem. It n... more >>
PNG and .NET
Posted by Derek Lakin at 8/19/2003 2:28:28 PM
I have the following code to extract a bitmap from a resource dll (standard,
not .NET satellite):
public static Bitmap GetBitmap(string shellPath, int id)
{
System.IntPtr hModule = Kernel32.LoadLibraryEx(shellPath,
System.IntPtr.Zero, Kernel32.LOAD_LIBRARY_AS_DATAFILE);
System.IntPtr hBi... more >>
Printing in Win98 w/ VB .Net App
Posted by M K at 8/19/2003 11:59:12 AM
I have some weird things going on. I get an 'Overflow or
underflow in the arithmetic operation.' message when
printing to a Samsung printer (ML-1200) or any other
printer that is not the default printer. (If I have the
Samsung as the default I get the message.)
Other printers do not give ... more >>
Corrupted 32b icons in toolbars etc
Posted by sam at 8/18/2003 8:32:10 PM
Hi
How do I get toolbars and menus to show the 32b color depth version of my
icons?
I store my icons as embedded resources and load them from the manifest
resource stream. If the .ico file has a 32b color version, the icons always
appear corrupted; if they only have a 256 color version in t... more >>
Motion JPEG
Posted by Danny Chan at 8/18/2003 7:37:10 AM
I am working on MJPEG programming to reduce the size, pixel and
resolution of the input MJPEG file from my video streamer. Wondering if
there are any existing codes that can help me out in these area. I will
be using Visual C/C++ to do the programming. Thank you
*** Sent via Developersdex h... more >>
Bitmap.FromFile doesn't load alpha?
Posted by Ray Price at 8/17/2003 8:14:44 PM
I tried loading a 32-bit argb bitmap, and it gets loaded
as 32bit rgb without the alpha information. What gives?
How can I get it to load as a 32-bit argb?
Thanks
Ray
... more >>
System.Drawing module raises a System.ArithmeticException
Posted by Avi Farah at 8/17/2003 6:35:12 PM
I do not know what I did to get this condition and hope
that someone can shed some light on it.
As of late I get a System.ArithmeticException raised by
the System.Drawing module. Steps to getting the
exception in VS.Net 2003 (and VS.Net 2002):
If I run an empty form I do not get the exc... more >>
This is tooo complex for me
Posted by Smoke at 8/16/2003 7:51:59 PM
Sorry for many posts about the same topic, but i cant get this working
i have been reading many articles about image processing and they are all writed in C#, i was able to get them working, and i dont
know nothing about C#, i just did a copy/paste
my problem now is that i cant convert them to my... more >>
getting image files
Posted by Oterox at 8/16/2003 7:16:21 PM
Hi.
How can i select *.jpg and *.gif files from a dir??
I'm using this:
Directory.GetFiles(PathVar, "*.jpg")
but i don't know how to get more extensions than *.jpg
Thank you
... more >>
VB.net picture box image
Posted by Neil Crosby at 8/16/2003 5:24:09 PM
If I load a picture from file into a VB.net picture box image, I can
save it as another file name.
If I try to save the picture box image back to the same path and file
name that was loaded, I get an error.
Can you tell me how to fix this, please?
... more >>
Form Transparency, click through semi transparent form
Posted by Mark Redman at 8/15/2003 2:51:53 PM
Hi All,
I know I can set a form Opacity and set the TransparencyKey properties but I
need to get a combination of the two where I can "see"(click through or
other mouse events) through a hole or shape in the form where the hole has
an opaque colour and is not completely transparent, like a fil... more >>
Image.FromStream eat too much memory
Posted by qiyue fei at 8/15/2003 1:18:47 PM
For instance, if the stream Length is 300K, after I call this method, the
memory usage increase 2000K. Is this normal???
Thank you
... more >>
Multipage Tif viewer (newbie)
Posted by SF at 8/15/2003 7:58:57 AM
Folks,
I've been running into problems with a multipage Tif viewer that I wrote to
display fax images in an ASP.Net app. I've been basically following the
standard examples on how to do this:
- Read the image from a file
- set the active frame (for the requested page in the Tif)
- write th... more >>
Create Bitmap from rawbuffer(BYTE*)
Posted by Soja at 8/14/2003 3:01:21 PM
How can i create a Bitmap from a rawbuffer-BYTE* (from framegrapper).
I do following:
Bitmap *myBit2 = new
Bitmap(wImage,hImage,wImage*sizeof(BYTE),PixelFormat::Format8bppIndexed
,(IntPtr)pbyteBuffer);
pictureBox->set_Image(myBit2 );
the Bitmap were not correct displayed
MFC
Soja
... more >>
How to draw on PNG image
Posted by Naveen K Kohli at 8/14/2003 1:26:22 PM
I have PNG image. I want to draw something on it. The problem is that the
image has pixel format of PixelFormat1bppIndexed. So the following call
fails.
Graphics *pG = Graphics::FromImage(&srcImage);
Is there a way to overcome this issue?
Thanks
... more >>
Arithmetic Exception upon loading form
Posted by Stoetti at 8/14/2003 8:23:48 AM
I have a big problem with .NET.
I know that this problem is already treated in the Microsoft Knowledge =
Base Article - 326219
http://support.microsoft.com/default.aspx?scid=3Dhttp://support.microsoft=
..com:80/support/kb/articles/q326/2/19.asp&NoWebContent=3D1
but the solution which is provi... more >>
DrawImage alpha blending against the desktop?
Posted by Gabe at 8/14/2003 7:51:56 AM
Hi all,
I'm in a rut with a project I'm working on. I'm building a shortcut bar
much like the one in OS X, basically a transparent panel with fully opaque
bitmaps (with alpha transparency support) that grow/shrink etc much like
this screenshot:
http://www.dca.net/support/images/osxscreen1.... more >>
The Matrix constructor Matrix(Rectangle, Points[])
Posted by oren_gabay NO[at]SPAM hotmail.com at 8/14/2003 6:17:54 AM
Hi All,
I want to use Matrix(Rectangle, Points[]) to build a transformation
that will set the origin to the lower left corner. The form size is:
500,500 pixel but in world unit I set width = height= 500 (so I will a
scale (!=1) on both axes).
This is the code I wrote (in the form1 construct... more >>
Font.FromLogFont producing strange results
Posted by Justin Van Patten at 8/13/2003 6:47:49 AM
Hello,
I am having trouble converting a LOGFONT structure to a System.Drawing.Font
object.
I'm calling SystemParametersInfo to get the LOGFONT lfntSMCaptionFont from a
NONCLIENTMETRICS structure. I seem to be doing this correctly, but when I
try to create a System.Drawing.Font object with ... more >>
Using printer fonts
Posted by garrick svetov at 8/13/2003 6:37:23 AM
I am using a specialty (receipt/barcode) printer which has
built in fonts (including barcode fonts). I'd like to
print to this printer using the built in fonts. They are
available via Wordpad, and I can find/select it for
printing in VB6 by enumerating priner fonts in the printer
object. ... more >>
URGENT: Internet Explorer Control: Print not working
Posted by Shardool Karnik at 8/12/2003 5:37:12 PM
Hi,
I have an ASP.NET page that sends a request to the server to generate some
html on the fly and print it through the server.
Once the request comes in, the page is generated.
I have a Internet Explorer Control that loads this page on the server side.
Then I am calling the print function ... more >>
Drawing Text
Posted by Rahul Kumar at 8/12/2003 4:13:21 PM
Hi
How do we draw text at an angle using Graphics object?
Thanks
RK
... more >>
|