Click here to Skip to main content
15,894,180 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to manager the uri in C# Pin
silva10322-Oct-09 4:03
silva10322-Oct-09 4:03 
QuestionUsing keyboard's key instead of the buttom. Pin
niammirzaei21-Oct-09 16:22
niammirzaei21-Oct-09 16:22 
AnswerRe: Using keyboard's key instead of the buttom. Pin
Richard Andrew x6421-Oct-09 16:47
professionalRichard Andrew x6421-Oct-09 16:47 
GeneralRe: Using keyboard's key instead of the buttom. Pin
niammirzaei21-Oct-09 18:58
niammirzaei21-Oct-09 18:58 
QuestionPhone Calls Pin
Bismark Appah21-Oct-09 14:55
Bismark Appah21-Oct-09 14:55 
AnswerRe: Phone Calls Pin
Richard Andrew x6421-Oct-09 15:56
professionalRichard Andrew x6421-Oct-09 15:56 
GeneralRe: Phone Calls Pin
Bismark Appah21-Oct-09 22:05
Bismark Appah21-Oct-09 22:05 
QuestionCut and Paste Attachements from Outlook Pin
werner2721-Oct-09 10:26
werner2721-Oct-09 10:26 
QuestionHow To Make A Data Bound Control Pin
Kevin Marois21-Oct-09 10:15
professionalKevin Marois21-Oct-09 10:15 
AnswerRe: How To Make A Data Bound Control [modified] Pin
Eddy Vluggen21-Oct-09 11:26
professionalEddy Vluggen21-Oct-09 11:26 
GeneralRe: How To Make A Data Bound Control Pin
Kevin Marois21-Oct-09 13:52
professionalKevin Marois21-Oct-09 13:52 
Questionis it possible to scroll Microsoft Word, Excel? Pin
venkat S0721-Oct-09 7:24
venkat S0721-Oct-09 7:24 
Questionis it possible to get the scrollbar info from IE via user32.dll or any provider? how? Pin
venkat S0721-Oct-09 7:19
venkat S0721-Oct-09 7:19 
QuestionConverting to WMF Pin
mypicturefaded21-Oct-09 5:31
mypicturefaded21-Oct-09 5:31 
AnswerRe: Converting to WMF Pin
Richard MacCutchan21-Oct-09 5:39
mveRichard MacCutchan21-Oct-09 5:39 
GeneralRe: Converting to WMF Pin
mypicturefaded21-Oct-09 5:45
mypicturefaded21-Oct-09 5:45 
GeneralRe: Converting to WMF PinPopular
mypicturefaded21-Oct-09 5:52
mypicturefaded21-Oct-09 5:52 
GeneralRe: Converting to WMF Pin
Richard MacCutchan21-Oct-09 5:53
mveRichard MacCutchan21-Oct-09 5:53 
GeneralRe: Converting to WMF Pin
mypicturefaded21-Oct-09 9:01
mypicturefaded21-Oct-09 9:01 
I have also tried this, it doesn't work, it seems to be a little closer though.
Read my post right above your last one, it states .Net doesn't have an encoder for saving as .wmf so it just makes it a .png file.

Here is my new code:

int width, height;
string filename = "testresult.wmf";

try
{
    Bitmap Sig = new Bitmap("test.bmp");

    width = Sig.Width;
    height = Sig.Height;

    Graphics sigGraphics = Graphics.FromImage(new Bitmap(width, height));
    IntPtr SigHDC = sigGraphics.GetHdc();

    Rectangle Bounds = new Rectangle(0, 0, width, height);

    Metafile sigMetaFile = new Metafile(filename, SigHDC, Bounds, MetafileFrameUnit.Pixel);
    sigGraphics.ReleaseHdc(SigHDC);

    sigGraphics = Graphics.FromImage(sigMetaFile);
    sigGraphics.PageUnit = GraphicsUnit.Pixel;
    sigGraphics.Clear(Color.White);
    sigGraphics.DrawImage(Sig, Bounds);

    sigGraphics.Save();

    sigGraphics.Dispose();
    sigMetaFile.Dispose();

    Image SigN = Image.FromFile("testresult.wmf");
    MessageBox.Show(SigN.RawFormat.Guid.Equals(ImageFormat.Wmf.Guid).ToString());

}

catch (Exception Meta)
{
    MessageBox.Show(Meta.ToString());
}


The last two lines of the try statement check to see if it is truly a .WMF. On my other files, it returns true. When I run them through this though, it returns false.
GeneralRe: Converting to WMF Pin
Richard MacCutchan21-Oct-09 11:10
mveRichard MacCutchan21-Oct-09 11:10 
AnswerRe: Converting to WMF Pin
Luc Pattyn21-Oct-09 11:22
sitebuilderLuc Pattyn21-Oct-09 11:22 
QuestionWhat is the best way to call methods in a commom class? Pin
CBenac21-Oct-09 5:04
CBenac21-Oct-09 5:04 
AnswerRe: What is the best way to call methods in a commom class? Pin
Luc Pattyn21-Oct-09 5:07
sitebuilderLuc Pattyn21-Oct-09 5:07 
GeneralRe: What is the best way to call methods in a commom class? Pin
CBenac21-Oct-09 13:36
CBenac21-Oct-09 13:36 
GeneralRe: What is the best way to call methods in a commom class? Pin
Luc Pattyn21-Oct-09 13:43
sitebuilderLuc Pattyn21-Oct-09 13:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.