Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2004, 05:24 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to open a file in c#?

I want to open a BMP(bitmap picture) sourcecode file in c#,could you help me? I'm a begainner.thank you very much.

 
Old September 24th, 2004, 10:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

What do you mean with "open a BMP(bitmap picture) sourcecode file"? What are you going to do with the bitmap once you have opened it?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Numb by Portishead (Track 6 from the album: Dummy) What's This?
 
Old September 24th, 2004, 10:14 PM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello,thank you,my English is not good.
I only want to know how to open it,and how to search which parts mean its wide or heigh,etc.
I am begainner in c#,so i can't do nothing now.

 
Old September 25th, 2004, 03:39 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you try Google for this? There are tons of articles about image handling in C#.

Anyway, like I asked before: what are you going to do with the bitmap? Do you just need the width and height? Or are you going to change the image, load it in a PictureBox or do something else with it?

But in its simplest form, you retrieve the Width and Height like this:
Code:
  Image curImage = Image.FromFile(@"C:\MyBitmap.bmp");
  MessageBox.Show(curImage.Width.ToString());
  Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
open a text file azalia Beginning VB 6 1 April 10th, 2007 08:09 AM
Open the "Open File" dialogue box piratelordx Access VBA 4 March 14th, 2006 10:08 PM
open excel file C# ? npqk VS.NET 2002/2003 2 November 26th, 2004 10:31 AM
open the file altafingar Classic ASP Databases 3 August 26th, 2004 07:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.