I Know WPF is DPI indipented when putting it on screen. Does that extend to Printing? I am using Drawing Context and all values are pixel based. My Printer has resolution 600dpi. But other printer that is currently not awaible is STAR SP 200 Series. It is a 300DPI Matrix type printer.
Saksida Bojan
Posts
-
[SOLVED] WPF Printing in milimeters -
[SOLVED] WPF Printing in milimetersHello I am using DrawingContext to draw text, and then i print visual throu PrintDialog. I want to convert input from milimeters. I do not know formula and on google i only found a few pieces, but i realy want to be printer independet. I found on a Some page 1 mm = 3.779528 px Is this printer independet. I am writing an application that will print on normal A4 printer or on 60mm x Reciept type printers. My app is already printing, but some values i want to be in pixel and some in mm. Thank you Edit: Upon remote testing i noticed that no matter if Printer is 600DPI or 300dpi. I can simply ignore these values
-
[SOLVED] WPF Combobox background colorI was searching for a tool that is capable extracting Styles/Theme. I know it exsist, because i had it a few years ago. I tried VS2012 And Blend. What i noticed is that when using create a copy of style is not a perfect. I am using it on Windows 8 and border has sharp edges, and when applying a copy of a style, my controls border get rounded. On top of all when i creadet a copy, my background property took an effect i wanted it to do in the first place, without modifiying style??? I was realy suprised by this. I got it working. Thanks for sugestion.
-
[SOLVED] WPF Combobox background colorNot an issue. I also found out what to change with WPF inspector. But i do not know how. I replied to Mycroft Holmes with detail on what to change.
-
[SOLVED] WPF Combobox background colorOn google all i could find how to change drop down box when i click on combo box. Same goes for that link on CP. And i do not need that. I wanted a backgroud color changed directly on combobox and not on the drop down list. Upon further investigation by WPF inspecotrs I found that there is a specific background property on the child visual tree
ComboBox
Grid(templateRoot)
Popup (PART_Popup)
ToggleButton (toggleButton)
Border (templateRoot)
Border (splitBorder)
Path (Arrow)
ContentPresenter (contentPresenter)
TextBlockI Have to change templateRoot background property. But i do not know how. I am noob at WPF
-
[SOLVED] WPF Combobox background colorHello, I know this is a silly question but i am stunned by this. Among controls that I use like DecimalUpDown (From WPF toolkit), textboxes and comboboxes. For all controls that are required to be filled, I have set the background color to LightYellow. I am not so successful, because i am failing to applay to combobox. No matter what background property is, Combo box ignores/overrides it. I do not wan't to change any apperances of any ComboBoxItems. Also Since i need it on Windows XP, my Framework target is 4.0 Any help is appreciated.
-
WPF Simular to tree viewThanks for suggestion, but i didn't knew what to search. I am currently reading a WPF book and in a book i saw word diagram in it. At that moment i found WPF Diagram Designer article that is perfect. Since my native language is not english i could not remeber word, that would help me search on google
-
WPF Simular to tree viewHello. I would like to present in a flat area a tree like view. Each item would be a non-movable panel with its own controls. Each child will have connected with a line (Also selectable). On top of it, some childs are going to have multiple parrents. The closest that i have seen to compare is code map in VS2012 Update 2. Example: Panel 1 and 2 are parents of panel 3
Panel1 Panel2
| || Panel3
I would like some pointers where to go, or if there is a custom control as long as it is free and can redistribute with or without source code. When i finish my personal project i will release source. As i am hobbiest programmer, my understanding on WPF is limited, so thank you for your time and patience.
-
Code should be 5 or anything above 7 long...Difference between VB or C# is a syntax, thanks to the .net framework. But if you ask what do I think is that C# is better. But ultimately it comes toward preference.
-
Changes made in visual studio do not show in browserI think the browser cached that page. You need to clear cache. I know that FireFox users can press CTRL+R to reload. I do not know for chrome or IE
-
WPF path data converterthanks, thats the info i was looking for.
-
WPF path data converterSledgeHammer01 wrote:
You mean convert the path into a bunch of line segments?
That is what i meant. I know it doesn't have anything with blend.
SledgeHammer01 wrote:
By the way, that IS a "normal XAML graphic"... Paths have nothing to do with Expression Blend
I didn't knew how to express it
SledgeHammer01 wrote:
Not sure why you want to do that.
I may not be able to use Bleend in the future but i want to see how complex graphic comes together.
-
WPF path data converterCurently i have downloaded expression blend trial to see what i do. I have made simple triangle.
So my question is, is there a tool that can convert StreamPathGeomtry (Path.Data) into a normal XAML graphic no matter how complex is? I want to see how complex graphics works. I appreciate any help. PS: Do not convert this for me.
-
WpfThere are sevral ways you can send complex information from child. If you use modal mode you can always loog into child while variable is stil accsessible.
if (true)
{
ChildForm frm = new ChildForm();
frm.ShowDialog(this); // Modal accsess
MessageBox.Show(frm.StringToGet();
}
// MessageBox.Show(frm.StringToGet(); // This is outside scope of frm. Here form no longer exsistYou can use static class, so that class does not need to be intilaized and can be accsessd from any Form.
public static class staticClass
{
static staticClass() // static class constructior
{
SomeText = "Intalized in constructior";
}
static ~staticClass(){} // destructor of static classpublic static String SomeText;
}// parentForm
if (true)
{
MessageBox.Show(staticClass.SomeText); // returns Intalized in constructior
ChildForm.ShowDialog();
MessageBox.Show(staticClass.SomeText); // returns other string that was changed in child form
}And the third option is to pass a reference to a class or to a variable. This one is the most complex. But the static class should be the best option if first option is not enough.
-
WMPlayer Dll Import QuestionUnder normal circumates the dll is loaded from System32 folder unless it is present in the same folder as exe. Since i do not know if this dll is managed or unmanaged or COM dll. You can attempt to register dll. http://social.msdn.microsoft.com/Forums/en-AU/netfx64bit/thread/813f13ec-0180-496a-8af0-b57dfd4e4de4[^] If it is managed dll, maybe you can consider putting it as GAC (Global Assembly Cache) Edit: If you have 64bit os, for 32 bit process put in SysWOW64, for 64 bit process put in system32
-
C# PSAPI_VERSION. and sevral other question [modified] [Partialy Solved]Because I am gonna use WriteProcessMemory and ReadProcessMemory. Those calls does not support in .NET. I am creating a Memory Scanner. My personal project for hobby. I am creating similar to CheatEngine. The second thing is I want to learn PInvoke, even if it is harder.
-
C# PSAPI_VERSION. and sevral other question [modified] [Partialy Solved]In MSDN I found this for dll import used with PInvoke: Kernel32.dll on Windows 7 and Windows Server 2008 R2; Psapi.dll if PSAPI_VERSION=1 on Windows 7 and Windows Server 2008 R2; Psapi.dll on Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP/2000 So how do i do programaticly find PSAPI_VERSION? I already Can determent windows version. But i am missing from the List Windwos 2008 and R2. I am doing the folowing way:
public static EnumWinVer GetWindowsVersion()
{OperatingSystem os = Environment.OSVersion; Version vs = os.Version; // This switch is pre-NT version if (os.Platform == PlatformID.Win32Windows) { switch (vs.Minor) { case 0: return EnumWinVer.Win95; case 10: if (vs.Revision.ToString() == "2222A") return EnumWinVer.Win98SE; else return EnumWinVer.Win98; case 90: return EnumWinVer.WinME; } } else if (os.Platform == PlatformID.Win32NT) { switch (vs.Major) { case 3: return EnumWinVer.WinNT3\_51; case 4: return EnumWinVer.WinNT4\_0; case 5: if (vs.Minor == 0) return EnumWinVer.Win2000; else return EnumWinVer.WinXP; case 6: if (vs.Minor == 0) return EnumWinVer.WinVista; else return EnumWinVer.Win7; default: break; } } // This is supposed to be unreachable area. return EnumWinVer.Undefined;
}
I am looking into GetModuleFileNameEx. QueryFullProcessImageName also can do the job. But minimum OS is Vista. So what would happen when Dllimport calls function that doesn't exsist on current OS. So how do i handle that. Thanks in advance for any answers to those question. Have a nice day edit:
[DllImport("kernel32.dll", EntryPoint = "GetModuleFileNameEx")]
static extern int K32GetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, StringBuilder lpFilename, int nSize);[DllImport("psapi.dll", EntryPoint = "GetModuleFileNameEx")]
static extern int PSAPIGetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, StringBuilder lpFilename, int nSize);After this i will Handle System.EntryPointNotFoundExpection. No
-
Disappearing namespace? [modified]What error does it throw when you compile release version. Maybe something is missing. Maybe you should check the folowing: Debugging Design-Time Controls[^] Walkthrough: Debugging Custom Windows Form control at Design Time[^]
-
Disappearing namespace? [modified]Try using command Rebuild Soulution from Build menu. It will clean cache and build it again. Then try restarting visual studio. If those namespaces are in a diffrent project, then check references. Edit: You also coud try to delete .suo file that lies in the same folder that has a solution file. That file resets Certan IDE elements, but does not break project/solution. This file has hidden attribute. You need special settings to see it.
modified on Saturday, August 27, 2011 4:57 PM
-
A Combobox size within menu [modified]I did try Padding and Margin and it didn't work. I know the auto size is based on a child. But in my case i want it to be based on a parrent.