Click here to Skip to main content
15,916,693 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: What is the best way to call methods in a commom class? Pin
CBenac22-Oct-09 2:49
CBenac22-Oct-09 2:49 
AnswerRe: What is the best way to call methods in a commom class? Pin
dan!sh 21-Oct-09 5:32
professional dan!sh 21-Oct-09 5:32 
GeneralRe: What is the best way to call methods in a commom class? Pin
Not Active21-Oct-09 5:48
mentorNot Active21-Oct-09 5:48 
GeneralRe: What is the best way to call methods in a commom class? Pin
dan!sh 21-Oct-09 5:55
professional dan!sh 21-Oct-09 5:55 
GeneralRe: What is the best way to call methods in a commom class? Pin
Not Active21-Oct-09 6:28
mentorNot Active21-Oct-09 6:28 
GeneralRe: What is the best way to call methods in a commom class? Pin
dan!sh 21-Oct-09 7:26
professional dan!sh 21-Oct-09 7:26 
GeneralRe: What is the best way to call methods in a commom class? Pin
Not Active21-Oct-09 7:49
mentorNot Active21-Oct-09 7:49 
GeneralRe: What is the best way to call methods in a commom class? Pin
dan!sh 21-Oct-09 7:59
professional dan!sh 21-Oct-09 7:59 
GeneralRe: What is the best way to call methods in a commom class? Pin
Not Active21-Oct-09 8:28
mentorNot Active21-Oct-09 8:28 
Questionscript Pin
netJP12L21-Oct-09 4:53
netJP12L21-Oct-09 4:53 
AnswerRe: script Pin
dan!sh 21-Oct-09 5:29
professional dan!sh 21-Oct-09 5:29 

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.