|
You can get the properties of an EXIF image file (JPEG) using the Image.PropertyItems property easily enough. The format of those properties, however, you must parse yourself. While you said you can already read these, I'd still like to mention an article here on CodeProject, Photo Properties[^]. It's a popular article and a good read if you're doing this in C#.
For the format of the makernote property, see http://www.exif.org/makernotes/SanyoMakerNote.html[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
You might want to supply us with the Exception and the line that it occured on!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello is there any function of "strtod" in c#
i wil try Convert.ToDouble(); and double.parse();
it will throw Exception if any character occur in string but in vc it will not throw exception
char *string, *stopstring;
double x;
string = "3.1415926This stopped it";
x = strtod( string, &stopstring );
printf( "string = %s\n", string );
string = 3.1415926This stopped it
strtod = 3.141593
Stopped scan at: This stopped it
i will required it urgent
Tayyab
|
|
|
|
|
Take a look at double.TryParse .
|
|
|
|
|
I could be wrong (haven't tried it), but I don't think double.TryParse will work for you.
You could always write a quick little function for doing this yourself though. For example,
private double ParseString(string theString)
{
const char decimalPoint = '.';
int numDigitChars = 0;
bool foundDecimalPoint = false;
foreach(char ch in theString)
{
if(char.IsNumber(ch))
numDigitChars++;
else if(ch == decimalPoint && !foundDecimalPoint)
{
foundDecimalPoint = true;
numDigitChars++;
}
else break;
}
if(numDigitChars > 0)
return double.Parse(theString.Substring(0, numDigitChars));
else return 0;
}
...
string myDoubleString = "3.1457helloWorld";
double dbl = ParseString(myDoubleString);
Console.WriteLine(dbl);
#include "witty_sig.h"
|
|
|
|
|
Hello is there any function of strtod in c#
i will required it urgent
Tayyab
|
|
|
|
|
Convert.ToDouble(string)
Regards,
Björn Morén
Stockholm, Sweden
|
|
|
|
|
I am putting together an application that will sit in the systray.
To view the application window the user double clicks the systray icon, or right clicks and selects the necessary context menu option. When the user has finished looking at the application they would then minimise via a minimise button or the form minimise button.
Sounds simple enough, to handle the window state I have this very simple function
private void WindowControl()
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
else
{
this.WindowState = FormWindowState.Minimized;
}
}
There are two problems I am coming across, which I believe may be related :
1) When the application starts, the systray icon is display but a little application bar is also shown just above the start button.
2) When the user maximises the application bar disappears, the form is shown, when the user minimises the application bar reappears.
Basically I am looking for a way to completly hide the minimised application bar, to help this post a make a little more sense the following URL points to a screenshot of the problem (17k):
http://24601.net/images/bar.bmp
Thanks
M
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
At first i must say that i'm not familiar with using systray icons and so.
But regarding the description of your problem i think the Form.Hide method could help. Try to call it when you minimize and call Form.Show when you maximize your application.
|
|
|
|
|
Hi, I'm looking for a plug-in for Visual Studio .NET which can rename class and variable names safely and deeply. For example if I have a member variable in the class named binaryFormatter and I want to rename it to _binaryFormatter for instance, or I have a class named MyClass and I want to rename it to MyRenamedClass, the plug-in to rename all the occurrences safely. Anybody heard about some plug-in that can do this?
|
|
|
|
|
All I've ever used is Replace under the Edit menu...
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In Visual Studio 2005 (codename "Whidbey"), they are adding refactoring. I believe there is a commercial plugin for VS.NET 2003. Just google for "refactoring" and "VS.NET" or something similar.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi,
I'd like to write/read the properties of file information in window.
for example, when i have choosen any file, then click the right button. i can see properties in context menu.
generally there are three tabs ( general, security, summary etc)
information of general tab can extract the FileInfo Class.
but i don't have any idea how to extract or write the summary info.
they have information of title, author, description etc.
So how could I deal with this information?
please help!!
thanks.
|
|
|
|
|
see description of StgOpenStorageEx and IPropertyStorage in MSDN
|
|
|
|
|
Hi,
I am really thank your response.
but i'm afraid i cannot find any clue in msdn although i found it.
so. could you give some examples? also i'd like to develop this fuction by c#. is it possible?
|
|
|
|
|
HRESULT FileDocProps::ReadProps(String* fileName, Guid fmtid, IList* props)
{
CStringW swFileName(fileName);
FMTID iidFmtID;
SetGUID(iidFmtID, fmtid);
CComPtr<IPropertySetStorage> spPropSetStg;
CComPtr<IPropertyStorage> spPropStg;
HRESULT hr = S_OK;
hr = StgOpenStorageEx(
swFileName,
STGM_READ | STGM_SHARE_EXCLUSIVE,
STGFMT_ANY,
0, NULL, NULL,
IID_IPropertySetStorage,
reinterpret_cast<void**>(&spPropSetStg));
if (FAILED(hr)) return hr;
hr = spPropSetStg->Open(
iidFmtID,
STGM_READ | STGM_SHARE_EXCLUSIVE,
&spPropStg);
if (FAILED(hr)) return S_OK;
CComPtr<IEnumSTATPROPSTG> spEnum;
bool isANSI = false;
short codePage = 0;
hr = GetCodePage(spPropStg, codePage, isANSI);
if (FAILED(hr)) return hr;
bool isUnicode = codePage == 0x04B0;
hr = spPropStg->Enum(&spEnum);
if (FAILED(hr)) return hr;
STATPROPSTG sps;
while (spEnum->Next(1, &sps, NULL) == S_OK)
{
PROPSPEC pss;
PROPVARIANT pvs;
pss.ulKind = PRSPEC_PROPID;
pss.propid = sps.propid;
hr = spPropStg->ReadMultiple(1, &pss, &pvs);
if (FAILED(hr)) continue;
try
{
String* name = sps.lpwstrName ? new String(sps.lpwstrName) : 0;
Object* v = PropVarToObject(pvs, codePage);
PropInfo pi((int) pss.propid, name, v);
props->Add(__box(pi));
}
catch(...)
{
}
PropVariantClear(&pvs);
CoTaskMemFree(sps.lpwstrName);
sps.lpwstrName = NULL;
}
return S_OK;
}
|
|
|
|
|
Hi
I have strange problem. I want to owner draw my menu.
So i did as written everywhen set propery of all MenuItem.OwnerDraw = true;
I have implemented the MeasureItem, and DrawItem evnets.
Something funny happen , the Top item of the menu the MeasureItem is not called, (but the DrawItem called) so the to item of the menu are draw with witdh of 12 pixels.
All other submenu are drawen normaly both MeasureItem, and DrawItem evnets are called.
Thank you for your help.
|
|
|
|
|
I couldn't make heads or tails of the problem your having and since you didn't provide any code sample to examine either...
All I can do is point you to some articles on CodeProject here[^], here[^], and here[^].
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks I have found my bug. it was the order of setting the properties and events.
But i have encountered another problem.
Is there a way to set for top level menu items diferent fonts, and it will still look good.
I have looked all the examples. None of the examples shows how to set the font of the top level menu item.
Any hints?
|
|
|
|
|
You would have to ownerdraw the MenuItems. But before you actually start drawing, you would check to see what the MenuItem's Parent object. If it actually has one, Parent would return a Menu object representing the current MenuItem's parent. If this was a top level MenuItem, Parent would return Nothing (VB.NET) or null (C#). Then it's just a matter of picking the correct font depending on if Parent returned anything or not.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi Dave
I know how the check if menu item is top level.
But even if i set to all menuitem size ( in MeasureItem Method) hard coded values, in drawitem method i get value of the height as Windows Menu default height.
Here small example
public void MeasureItemMenuItem(object sender,
MeasureItemEventArgs e)
{ e.ItemWidth = 32;
e.ItemHeight = 32; // I set to hard coded value
}
public void DrawMenuItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
Rectangle destRect = e.Bounds;
destRect.Height; // The value for top level items
// is allways set to windows default (18)
}
|
|
|
|
|
Hi there,
I'm programming a software that will be used in a Server-Based Network using Windows 2000 Advanced Server and 2 DCs.
The software will do the following:
- In the midnight it will copy a files in another computer to this computer.
The problem is that when i try to do this manually it happens, because when my software asked for the file to be copied, windows will try to reach the file, and when he couldn't he will open a dialog with: "Connect As" to enter userid and password, if it's ok, Windows will create a ticket and will allow me to reach the file and choose it.
Now, how could i let my software do this programatically. I can reach Active Drectory, I get the user name and check if the password is ok, but still doesn't allows me to reach the file.
So, How could I reach the file which is in another PC (which means it requires a user/password login) programatically?
rami2k
|
|
|
|
|
If I understand correctly, setting the username/password on your DirectoryEntry should allow you to make the connection :
using (DirectoryEntry de = new DirectoryEntry())
{
de.Path = myLdapPath
de.AuthenticationType =
de.Username = "user";
de.Password = "Secret";
}
post.mode = postmodes.signature;
SELECT everything FROM everywhere WHERE something = something_else;
> 1 Row Returned
> 42
|
|
|
|
|
Thanks MrEyes, but this didn't work!
|
|
|
|
|
Your explanation is not easy to understand at all, but here goes...
For what I can figure out, you want to write an application that copies a file from one computer to the local computer, on a set schedule. The problem your running into is that your application is getting asked for a username and password when it tries to open the source file. Correct?
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|