473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can C# read geoTiff file?

When I tried

pictureBox1.Image = Image.FromFile("aGeoTiffFile.tif");

I got an error:
System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.

Can I load geoTiff file and access its meta info with C#?

Sep 15 '07 #1
3 8964
TIF supports a lot of random meta data that may or may not be
supported. If all you care about is the image itself, you should run
your images through a batch converter that supports that particular
variety of TIF and convert them to something more standard like PNG.
Otherwise you'll have to use a third party library built for such.
I've used ImageMagick before and liked it, though it may not support
all strange TIF data either. I would assume the defaykt C# library
would struggle with nonstandard indexing schemes as well as 16bit
channels. My guess is that they would handle an 8bit indexed TIF but
not a 12bit indexed TIF, etc.

Sep 15 '07 #2
System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.
Not supported with System.Drawing.Imaging(i.e., .Net 1.1, 2.0 )

It is supported by System.Media.Imaging(i.e., .Net 3.0 )

"FrankMeng" <me********@gmail.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.com...
When I tried

pictureBox1.Image = Image.FromFile("aGeoTiffFile.tif");

I got an error:
System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.

Can I load geoTiff file and access its meta info with C#?

Sep 15 '07 #3
If you search around, you can find some TIFF Image processing libraries for C#.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"FrankMeng" wrote:
When I tried

pictureBox1.Image = Image.FromFile("aGeoTiffFile.tif");

I got an error:
System.Exception: A Graphics object cannot be created from an image
that has an indexed pixel format.

Can I load geoTiff file and access its meta info with C#?

Sep 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Yang Li Ke | last post by:
Hi guys! I have some datas that I must check everytime a visitor comes to my site What is better to do: 1- Read data from a file or 2- Read data from a mysql db Thank you
3
by: Anne-Marte | last post by:
Hi I simply don't understand how to read a simple file using std::istream. How do I open a file for reading with istream?? Anne-Marte
7
by: Davy | last post by:
Hi all, A read-only data file is read in a C/C++ program. And now I use stdio function such as fopen() to fread() to operate the file. The content of the data file is constant. How to build...
1
by: TaeHo Yoo | last post by:
The file I would like to access in located in C drive and the application which reads the file is located in E drive. When it trys to read the file, it generates an error Error: Request for the...
2
by: Lam | last post by:
Hi the default readline method in StreamReader read the text from the top to bottom how can I read a text file from the bottom to the top? Thanks
3
by: Yaniv | last post by:
Hi I'm new in VB.NET. I wrote an application which opens a text file and read it all lines untill the EOF this file is open for read only and for sharing asllowed. every 5 seconds another...
10
by: Arquitecto | last post by:
Hi , I have a question about a file operation i want to do . I have a data file lets say X bytes . I want to read the file and delete a byte every 2nd byte . I am a little comfused ,my approach...
6
by: portCo | last post by:
Hello there, I am creating a vb application which is some like like a questionare. Application read a text file which contains many questions and display one question and the input is needed...
4
by: bmerlover | last post by:
How can you read a file in a timer function? I am currently using a do while statement to read a file which works fine. The implementation is in C but I've added the code to a C++ .NET framework GUI...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.