|
There might be something in the dotnet libary that can do this but I've never done that before so I don't know. I do know you can do it by opening a file as a file stream then reading the header for the file.
Basically the headers are usually different for different file types so you'll have to look up information on each of the file types you are interested in.
Hope this helps,
Mike
|
|
|
|
|
|
Thanks for your replys. i have tried this property but i couldnt find which code means which property.
sniper47 Computer Engineer
|
|
|
|
|
Hi,
AFAIK these properties are optional, and supported by JPEG only.
These are the propID, propName pairs I recovered from some code:
Hashtable propNames=new Hashtable();
propNames.Add(0x010E, "ImageDescription");
propNames.Add(0x010F, "EquipMake");
propNames.Add(0x0110, "EquipModel");
propNames.Add(0x0112, "Orientation");
propNames.Add(0x011A, "XResolution");
propNames.Add(0x011B, "YResolution");
propNames.Add(0x0132, "DateTime");
propNames.Add(0x0128, "ResolutionUnit");
propNames.Add(0x0131, "SoftwareUsed");
propNames.Add(0x0201, "JPEGInterFormat");
propNames.Add(0x0202, "JPEGInterLength");
propNames.Add(0x0213, "YCbCrPositioning");
propNames.Add(0x501B, "ThumbnailData");
propNames.Add(0x502D, "ThumbnailResolutionX");
propNames.Add(0x502E, "ThumbnailResolutionY");
propNames.Add(0x5090, "LuminanceTable");
propNames.Add(0x5091, "ChrominanceTable");
propNames.Add(0x829A, "ExifExposureTime");
propNames.Add(0x9003, "ExifDTOrig");
propNames.Add(0x9004, "ExifDTDigitized");
propNames.Add(0x9204, "ExifExposureBias");
propNames.Add(0x9209, "ExifFlash");
propNames.Add(0x927C, "ExifMakerNote");
propNames.Add(0x9286, "ExifUserComment");
propNames.Add(0xA002, "ExifPixXDim");
propNames.Add(0xA003, "ExifPixYDim");
and this shows the kind of code you will need to extract a property:
PropertyItem pi=image.GetPropertyItem(ID);
s="";
byte[] bb=pi.Value;
switch ((PropertyTagType)pi.Type) {
case PropertyTagType.Byte:
type="(byte)";
for (int i=0; i<bb.Length; i++) {
byte us=bb[i];
s+=" "+us.ToString("X2");
if (bb.Length==1) s+="("+us.ToString()+")";
}
break;
case PropertyTagType.ASCII:
type="(ASCII)";
s=" "+ASCIIencoding.GetString(pi.Value, 0, pi.Len-1);
break;
case PropertyTagType.Short:
type="(short)";
for (int i=0; i<bb.Length/2; i++) {
ushort us=BitConverter.ToUInt16(bb,2*i);
s+=" "+us.ToString("X4");
if (bb.Length==2) s+="("+us.ToString()+")";
}
break;
...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi all,
I have loaded 3D model using Direct 3d retained mode. I have to display label for all faces available in a mesh.
Kindly tell me how to add a label for a face using Direct 3d retained mode.
|
|
|
|
|
I have some pretty basic code that loads a texture, and tries to display it all across my terrain, however, it does not seem to be working and I can't for the life of me figure out why.
The loading code is here:
ifstream texFile("brickbump.bmp");
if (texFile.is_open())
{
AUX_RGBImageRec* image = auxDIBImageLoad("brickbump.bmp");
glGenTextures(1, &m_textures[0]);
glBindTexture(GL_TEXTURE_2D, m_textures[0]);
glTexImage2D(GL_TEXTURE_2D, GL_RGB8, 3, image->sizeX, image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image->data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
texFile.close();
free(image);
}
After this, I have my function that redraws everything. Since it is too long, here is the important snippet:
glBindTexture(GL_TEXTURE_2D, m_textures[0]);
QuadVNode* tempNode = m_terrain->Tree()->GetFirstNode();
QuadVNode* nextLineNode = tempNode->Bottom();
int count = 0;
while (nextLineNode)
{
glBegin(GL_TRIANGLE_STRIP);
while (tempNode)
{
glNormal3d(tempNode->m_nx, tempNode->m_ny, tempNode->m_nz);
if (count % 2 == 0)
glTexCoord2d(0.0f, 0.0f);
else if (count % 2 == 1)
glTexCoord2d(1.0f, 0.0f);
glVertex3d(tempNode->m_x, tempNode->m_height, tempNode->m_z);
tempNode = tempNode->Bottom();
glNormal3d(tempNode->m_nx, tempNode->m_ny, tempNode->m_nz);
if (count % 2 == 0)
glTexCoord2d(0.0f, 1.0f);
else if (count % 2 == 1)
glTexCoord2d(1.0f, 1.0f);
glVertex3d(tempNode->m_x, tempNode->m_height, tempNode->m_z);
tempNode = tempNode->Top()->Right();
count++;
}
glEnd();
tempNode = nextLineNode;
nextLineNode = nextLineNode->Bottom();
}
My problem is that it doesn't display the texture. All it does is draw it as if I had simply done glNormal/glVertex over and over again, discarding the glTex2Coord call in between. Another thing I should mention is that I do have glEnable(GL_TEXTURE_2D) somewhere in my initialization code. Also, it does actually find the texFile, and sets m_textures[0] to an unsigned value of 1 when I call glGenTextures().
|
|
|
|
|
Alright, this happened to be a fluke, but I went digging around in the documentation, and it was suggested that I use 0 for the second parameter to glTexImage2D, and now it works. I don't know where I came up with RGB_8 as the constant to use there, but this solves the problem.
|
|
|
|
|
I'm doing something with a bitmap and as many of you probably know the getpixel and setpixel functions are heinously slow so I'm simply opening the bitmap as a filestream and manipulating the bytes directly which is much faster. Anyways is there anyway I can display this filestream directly on a picuturebox without having to close the file then load it again from its location in the hard drive.
thanks,
Mike
|
|
|
|
|
Image.FromStream() accepts a FileStream.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
i want to display an image which is over 400M size by the following ways:
1) GDI+
2)OPenGL (load the image as texture)
but it dosn't work, since i can display little size image by these two methods, is there size limit to display so big image?
thanks
|
|
|
|
|
Hi,
what is the size of your image (width and height in pixels)?
Lao Wang wrote: it dosn't work
What does that mean? Do you have code that does not compile, if so show the error message.
Do you get an exception at run-time, if so show us the code and the entire
exception.ToString().
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
thanks Pattyn:
the size of my image is 29000*15000.
there is no compile error, no run-time exception yet.
i can display an image of 9000*5000 size through GDI+ and OpenGL, but display nothing with the big image of 29000*15000.
so i want to know is there size limit of displaying an image by GDI+ and OpenGL?
|
|
|
|
|
Is it possible to break the picture down into smaller tiles ( I doubt the user is looking at the whole picture at once )?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
thanks
maybe i have to divide the big image into some little images before display it.
|
|
|
|
|
Adobe applications can display images that large, but nothing I've tried under win32 (including several OSS apps that could do it under *nix(64?)) was able to load the one image that big that I tried. I assume they're using some sort of divide and conquer approach instead of just trying to use the API native constructs.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
Lao Wang wrote: i want to display an image which is over 400M size by the following ways:
"display" is relative to your display, which theoretically is probably maxing out at 2560x1600 assuming a very nice monitor. Parse is another issue.
One method is through a form of Level of Detail mapping for imagery, you can zoom into any portion of a very large image, yet not have anything more than 512x512 on any given cell. You break the cells into quads and those quads into quads, and those quads into quads, etc. until you reach full resolution. Then the hard-part is paging those in and out. Real memory becomes a cache for tiles loaded off disk. Now you can pull any given section rapidly. The primary advantage of tiling is that it allows you to combine multiple things all tiled off the same zone. This is extremely common for imagery related to terrain as terrain elevation can be tiled as well as imagery, perhaps as well as soil, or vegetation, or other layers of information. Each layer of information may have a different size, but be tiled the same. Elevation could be 64x64 while satellite imagery 512x512, while soil types are 32x32 and vegetation 64x64. Tiling is common for two sources together, and more common the more layers you have to use together. It is very difficult and often expensive (performance wise) not to tile multiple layers.
Another method is through windowed compression. This is probably the easiest, though depending on the data source not always as good looking. ECW free version limits your images to 500M which is within your limits. A GNU license or commercial license will buy you unlimited sizes (limited by your hardware of course). ECW and Jpeg2000 are wavelet compression which is very easy to window. You can then store the entire image on disk as compressed wavelet information, and extract the "window" of the visible portions of the image.
ECW and Jpeg 2000[^]
Tiling textures[^]
Image Clipmapping[^]
ChunkLOD Implimentation (images and elevation data)[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
El Corazon wrote: "display" is relative to your display, which theoretically is probably maxing out at 2560x1600 assuming a very nice monitor.
He could be working with super premium type monitors used for medical imaging, etc. I know those can reach at least 8 megapixels.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
dan neely wrote: used for medical imaging, etc. I know those can reach at least 8 megapixels.
If I recall those max out at 3500x3500 monichrome or about 10+ megapixels. Okay, even assuming that monitor, the task is still the same. I regularly show full scale NASA blue marble next gen earth images, http://earthobservatory.nasa.gov/Newsroom/BlueMarble/BlueMarble_monthlies.html[^] at 86400x43200 for the 500m per pixel version. No matter what monitor you have, you can't show that image. We do have one live-camera that takes 4096x3072 images, we display it on a group of monitors. Even with that, you might have to partition the image live on each monitor so that you can see it on multiple computers. Once you have the partitioning technique down, you can do live displays of any resolution on any monitor, or group of monitors.
There are similar techniques for volumetric medical imaging, though no mention of that has been made here. The concept is still the same. Massive data is needed to view in zoom mode at full resolution, nothing held back. But zoomed out you can get away with a bit less data (no pun intended).
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
GDI+ is probably too naive to handle the image size on its own, or much too slow. There is no reason why it couldn't deal with it, in theory.
OpenGL is limited by your texture memory. No textures bigger than the texture memory can be loaded. You will want to load the file into memory (regular) and split it up, swapping out sections as needed.
Setting up a texture in OpenGL moves data from RAM to VRAM and freeing the texture id will release it from VRAM so that you have space to load another etc... 4GB of RAM (page file) should be plenty enough for a 400M image.
This kind of resolution is enormous, if you are going to put it all on screen at once I would recommend downsizing it first, i.e. pre-build files which are downsized, otherwise you will have the same memory problems, not to mention the ugly aliasing effects.
Hope this helps.
|
|
|
|
|
Everything I try just ends up failing. I have a 3d file with bones and a mesh with key frames in a .X(directX mesh file). I can render a sigle mesh. However when it is animated I can't.
I looked in the sample code provided with DirectX smaple (Simple animation) which isnt simple at all. I understand coding well and how 3d graphics work and alot of directX. I just cant for some reason get an animation to render.
Advice, links, downloads, any thing that will point me in the right diretion will be helpful.
I feel like I been around the web and back a few times trying to find this.
|
|
|
|
|
hii.. is there any application by which we can divide the computer screen into two or more parts so that we can see more the two application simultaneously running on the screen. Please do reply if any body has any idea or any linl regarding this.. Thanx
prashant
prashant
|
|
|
|
|
Hi,
Prashant, what tools you are using? If using OpenGL with C++/VC++ it can be done, by creating two windows, you will have to manually adjust their size, and preferably you will like to disable the Maximize option for them.
Regards,
Adeel
|
|
|
|
|
according the GPS position information, i want to splice two images. but the two images have diffrent color palette, i can not simply replace or add one image's pixels with another image's pixels.
anyone can give me some suggestion?
thanks
|
|
|
|
|
Quick and dirty : you could do an pixel average between the 2 images.
|
|
|
|
|