Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Send key strokes to terminal server window Pin
Skippums26-Nov-07 6:52
Skippums26-Nov-07 6:52 
GeneralRe: Send key strokes to terminal server window Pin
mav.northwind26-Nov-07 21:55
mav.northwind26-Nov-07 21:55 
GeneralRe: Send key strokes to terminal server window Pin
mav.northwind27-Nov-07 21:01
mav.northwind27-Nov-07 21:01 
GeneralRe: Send key strokes to terminal server window Pin
Skippums28-Nov-07 4:53
Skippums28-Nov-07 4:53 
Questionservice doesn't register Pin
stephan_00720-Nov-07 3:49
stephan_00720-Nov-07 3:49 
AnswerRe: service doesn't register Pin
led mike20-Nov-07 5:02
led mike20-Nov-07 5:02 
GeneralRe: service doesn't register Pin
stephan_00720-Nov-07 22:13
stephan_00720-Nov-07 22:13 
QuestionMetafile problem... Pin
devzav20-Nov-07 3:36
devzav20-Nov-07 3:36 
Hi all! I'm coding a class to print barcodes. One of my methods is this:

public Metafile GetMetafileImage()<br />
		{<br />
			PrinterSettings ps = new PrinterSettings();<br />
			Graphics g = ps.CreateMeasurementGraphics();<br />
			IntPtr pHdc = g.GetHdc();<br />
<br />
			Metafile mf = new Metafile(pHdc, EmfType.EmfOnly);<br />
<br />
			g.ReleaseHdc(pHdc);<br />
			g.Dispose();<br />
			g = Graphics.FromImage(mf);<br />
<br />
			g.PageUnit = GraphicsUnit.Millimeter;<br />
			g.PageScale = 1;<br />
<br />
			Brush b = Brushes.White;<br />
			g.FillRectangle(b, 0, 0, whiteMarginWidth, height);<br />
<br />
			<br />
			float x = whiteMarginWidth;<br />
			<br />
			foreach (char ch in encodedValueString)<br />
			{<br />
				if (ch == '1')<br />
					b = Brushes.Black;<br />
				else<br />
					b = Brushes.White;<br />
<br />
				g.FillRectangle(b, x, 0, x + barSize, height);<br />
<br />
				x += barSize;<br />
			}<br />
<br />
			b = Brushes.White;<br />
			g.FillRectangle(b, x, 0, x + whiteMarginWidth, height);  // <-- this<br />
<br />
			g.Dispose();<br />
<br />
			return mf;<br />
		}


It works fine but the last FillRectangle operation. Its width isn't "whiteMarginWidth", but it's larger than "whiteMarginWidth". It seems to fill a rectangle whose wide reach the "end" of a region, perhaps a region set by the printer handle...
I can't solve this problem D'Oh! | :doh: Can you help me?

Thank you!

Luca
AnswerRe: Metafile problem... Pin
Skippums20-Nov-07 3:56
Skippums20-Nov-07 3:56 
AnswerRe: Metafile problem... Pin
devzav20-Nov-07 4:24
devzav20-Nov-07 4:24 
QuestionScan for Terminal Servers? Pin
Stimul8d20-Nov-07 3:15
Stimul8d20-Nov-07 3:15 
AnswerRe: Scan for Terminal Servers? Pin
Stimul8d20-Nov-07 4:43
Stimul8d20-Nov-07 4:43 
QuestionEvent to capture IP Packets Pin
Activwerx inc.20-Nov-07 3:01
Activwerx inc.20-Nov-07 3:01 
AnswerRe: Event to capture IP Packets Pin
Activwerx inc.20-Nov-07 11:43
Activwerx inc.20-Nov-07 11:43 
QuestionIni File, Read From Txt File Pin
half-life20-Nov-07 2:09
half-life20-Nov-07 2:09 
AnswerRe: Ini File, Read From Txt File Pin
Jason Lepack (LeppyR64)20-Nov-07 3:14
Jason Lepack (LeppyR64)20-Nov-07 3:14 
QuestionPlease Help me in Crystal Report Pin
Mujahid Awan Sindhi20-Nov-07 2:07
Mujahid Awan Sindhi20-Nov-07 2:07 
AnswerRe: Please Help me in Crystal Report Pin
Rocky#20-Nov-07 4:03
Rocky#20-Nov-07 4:03 
AnswerRe: Please Help me in Crystal Report Pin
Ennis Ray Lynch, Jr.20-Nov-07 5:27
Ennis Ray Lynch, Jr.20-Nov-07 5:27 
Questionhide IP address Pin
sivaramireddy p20-Nov-07 2:02
sivaramireddy p20-Nov-07 2:02 
AnswerRe: hide IP address Pin
Abhijit Jana20-Nov-07 2:07
professionalAbhijit Jana20-Nov-07 2:07 
GeneralRe: hide IP address Pin
sivaramireddy p20-Nov-07 2:16
sivaramireddy p20-Nov-07 2:16 
GeneralRe: hide IP address Pin
duncanmhor20-Nov-07 2:32
duncanmhor20-Nov-07 2:32 
AnswerRe: hide IP address Pin
Colin Angus Mackay20-Nov-07 2:45
Colin Angus Mackay20-Nov-07 2:45 
AnswerRe: hide IP address Pin
Activwerx inc.20-Nov-07 3:15
Activwerx inc.20-Nov-07 3:15 

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.