473,795 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can C# read geoTiff file?

When I tried

pictureBox1.Ima ge = Image.FromFile( "aGeoTiffFile.t if");

I got an error:
System.Exceptio n: 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 8986
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.Exceptio n: 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.Im aging(i.e., .Net 3.0 )

"FrankMeng" <me********@gma il.comwrote in message
news:11******** *************@g 4g2000hsf.googl egroups.com...
When I tried

pictureBox1.Ima ge = Image.FromFile( "aGeoTiffFile.t if");

I got an error:
System.Exceptio n: 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.Ima ge = Image.FromFile( "aGeoTiffFile.t if");

I got an error:
System.Exceptio n: 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
5332
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
6077
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
3066
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 the file into exe file. Any suggestions will be appreciated!
1
308
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 permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Cu lture=neutral, PublicKeyToken=b77a5c561934e089 failed. How to read the file?
2
6325
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
4223
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 applications write another line to this file at the end and I'm trying to read those new lines from my applications. the problem is that the EOF function returns TRUE even though a new lines added to this file.
10
2068
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 is like this . main() { char buf; FILE *fp;
6
2490
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 from user to calculate the score. Here is a problem. I can read a text file. However, it's read whole file at a time. So,
4
2156
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 app. This is the implementation that works: void findPacketHeaders(char *inputFile, char *outputFile) { /* Open file */ fpInput = fopen(inputFile, "rb"); fpOutput = fopen(outputFile, "w"); /* check if fpInput exists */
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.