Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
QuestionRunning a loop, try to get both [i] value (todayvalue), and [i - 1] value (yesterdays value) Pin
lordoftrades25-Apr-13 0:47
lordoftrades25-Apr-13 0:47 
AnswerOT Pin
Keith Barrow25-Apr-13 2:56
professionalKeith Barrow25-Apr-13 2:56 
GeneralRe: OT Pin
lordoftrades25-Apr-13 3:37
lordoftrades25-Apr-13 3:37 
GeneralRe: OT Pin
Keith Barrow25-Apr-13 6:26
professionalKeith Barrow25-Apr-13 6:26 
GeneralRe: OT Pin
lordoftrades25-Apr-13 20:29
lordoftrades25-Apr-13 20:29 
QuestionExRichTextBox Pin
Star.jon24-Apr-13 21:45
Star.jon24-Apr-13 21:45 
AnswerRe: ExRichTextBox Pin
Marco Bertschi24-Apr-13 22:10
protectorMarco Bertschi24-Apr-13 22:10 
GeneralRe: ExRichTextBox Pin
Star.jon25-Apr-13 20:32
Star.jon25-Apr-13 20:32 
C#
            StringBuilder _rtf = new StringBuilder();

            // Calculate the current width of the image in (0.01)mm
            int picw = (int)Math.Round((_image.Width / xDpi) * HMM_PER_INCH);

            // Calculate the current height of the image in (0.01)mm
            int pich = (int)Math.Round((_image.Height / yDpi) * HMM_PER_INCH);

            // Calculate the target width of the image in twips
            int picwgoal = (int)Math.Round((_image.Width / xDpi) * TWIPS_PER_INCH);

            // Calculate the target height of the image in twips
            int pichgoal = (int)Math.Round((_image.Height / yDpi) * TWIPS_PER_INCH);

            // Append values to RTF string
            _rtf.Append(@"{\pict\wmetafile8");
            _rtf.Append(@"\picw");
            _rtf.Append(picw);
            _rtf.Append(@"\pich");
            _rtf.Append(pich);
            _rtf.Append(@"\picwgoal");
            _rtf.Append(picwgoal);
            _rtf.Append(@"\pichgoal");
            _rtf.Append(pichgoal);
            _rtf.Append(" ");

// Not used in this application.  Descriptions can be found with documentation
// of Windows GDI function SetMapMode
private const int MM_TEXT = 1;
private const int MM_LOMETRIC = 2;
private const int MM_HIMETRIC = 3;
private const int MM_LOENGLISH = 4;
private const int MM_HIENGLISH = 5;
private const int MM_TWIPS = 6;
 
// Ensures that the metafile maintains a 1:1 aspect ratio
private const int MM_ISOTROPIC = 7;
 
// Allows the x-coordinates and y-coordinates of the metafile to be adjusted
// independently
private const int MM_ANISOTROPIC = 8;
 
// Represents an unknown font family
private const string FF_UNKNOWN = "UNKNOWN";
 
// The number of hundredths of millimeters (0.01 mm) in an inch
// For more information, see GetImagePrefix() method.
private const int HMM_PER_INCH = 2540;
 
// The number of twips in an inch
// For more information, see GetImagePrefix() method.
private const int TWIPS_PER_INCH = 1440;
 

 

// Get the horizontal and vertical resolutions at which the object is
// being displayed
using (Graphics _graphics = this.CreateGraphics()) {
    xDpi = _graphics.DpiX;
    yDpi = _graphics.DpiY;
}


The above is code!
GeneralRe: ExRichTextBox Pin
Star.jon25-Apr-13 20:35
Star.jon25-Apr-13 20:35 
GeneralRe: ExRichTextBox Pin
Marco Bertschi25-Apr-13 21:49
protectorMarco Bertschi25-Apr-13 21:49 
Questionhow to detect SoundEffect stoped in xna Pin
payjo24-Apr-13 15:15
payjo24-Apr-13 15:15 
Questionsetup error in c# Pin
User349024-Apr-13 4:11
User349024-Apr-13 4:11 
AnswerRe: setup error in c# Pin
Keith Barrow24-Apr-13 5:05
professionalKeith Barrow24-Apr-13 5:05 
QuestionCallBack to consumer using RESTful / MVC / WCF Pin
jexes23-Apr-13 22:51
jexes23-Apr-13 22:51 
QuestionProgramming a Symbol Handheld Scanner Pin
bob18123-Apr-13 20:57
professionalbob18123-Apr-13 20:57 
AnswerRe: Programming a Symbol Handheld Scanner Pin
Pete O'Hanlon23-Apr-13 21:29
mvePete O'Hanlon23-Apr-13 21:29 
AnswerRe: Programming a Symbol Handheld Scanner Pin
Joe Woodbury24-Apr-13 8:19
professionalJoe Woodbury24-Apr-13 8:19 
Questionprinting students grades after finding them in files.. Pin
Magda634723-Apr-13 9:30
Magda634723-Apr-13 9:30 
AnswerRe: printing students grades after finding them in files.. Pin
Eddy Vluggen23-Apr-13 9:36
professionalEddy Vluggen23-Apr-13 9:36 
QuestionWhich one is overriding and which one is overloading Pin
Arun kumar Gautam23-Apr-13 2:55
Arun kumar Gautam23-Apr-13 2:55 
AnswerRe: Which one is overriding and which one is overloading Pin
Keith Barrow23-Apr-13 3:07
professionalKeith Barrow23-Apr-13 3:07 
AnswerRe: Which one is overriding and which one is overloading Pin
ZurdoDev23-Apr-13 9:08
professionalZurdoDev23-Apr-13 9:08 
AnswerRe: Which one is overriding and which one is overloading Pin
Clifford Nelson24-Apr-13 14:23
Clifford Nelson24-Apr-13 14:23 
AnswerRe: Which one is overriding and which one is overloading Pin
Arun kumar Gautam24-Apr-13 19:22
Arun kumar Gautam24-Apr-13 19:22 
GeneralRe: Which one is overriding and which one is overloading Pin
Keith Barrow24-Apr-13 23:29
professionalKeith Barrow24-Apr-13 23: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.