Click here to Skip to main content
16,006,006 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to add text to the GridView in wpf? Pin
ABitSmart7-Sep-09 21:52
ABitSmart7-Sep-09 21:52 
GeneralRe: How to add text to the GridView in wpf? Pin
Krishna Aditya7-Sep-09 22:44
Krishna Aditya7-Sep-09 22:44 
QuestionHow to handle Refresh and Reset in WPF application in MVP application [modified] Pin
Krishna Aditya7-Sep-09 6:03
Krishna Aditya7-Sep-09 6:03 
QuestionChanging text from white to black for printing Pin
DavidRen236-Sep-09 23:10
DavidRen236-Sep-09 23:10 
AnswerRe: Changing text from white to black for printing Pin
Richard MacCutchan7-Sep-09 0:43
mveRichard MacCutchan7-Sep-09 0:43 
GeneralRe: Changing text from white to black for printing Pin
DavidRen237-Sep-09 0:59
DavidRen237-Sep-09 0:59 
GeneralRe: Changing text from white to black for printing Pin
Richard MacCutchan7-Sep-09 1:36
mveRichard MacCutchan7-Sep-09 1:36 
GeneralRe: Changing text from white to black for printing Pin
DavidRen237-Sep-09 3:30
DavidRen237-Sep-09 3:30 
The code for printing is below however the problem cannot be solved here can it?   The canvas background is not white, therefore white text appears fine, when printing the content of the canvas is printed on to white paper therefore the text is not visible.

<code>
PrintDialog printDlg = new System.Windows.Controls.PrintDialog();

                  DesignerCanvas designerCanvas = BloggsSDK.Windows.VisualTreeHelper.FindChild<DesignerCanvas>(this);
                  if (designerCanvas != null)
                  {
                        try
                        {
                              System.Printing.PrintCapabilities capabilities = printDlg.PrintQueue.GetPrintCapabilities(printDlg.PrintTicket);

                              //get scale of the print wrt to screen of WPF visual
                              double scale = Math.Min(capabilities.PageImageableArea.ExtentWidth / designerCanvas.ActualWidth, capabilities.PageImageableArea.ExtentHeight / designerCanvas.ActualHeight);

                              Rect bounds = VisualTreeHelper.GetDescendantBounds(designerCanvas); // not extent bounds
                              bounds.Scale(scale, scale);

                              DrawingVisual visual = new DrawingVisual();

                              using (DrawingContext dc = visual.RenderOpen())
                              {
                                    VisualBrush vb = new VisualBrush(designerCanvas);
                                    vb.Transform = new ScaleTransform(designerCanvas.ActualWidth / (Zoom * designerCanvas.ActualWidth), designerCanvas.ActualHeight / (Zoom * designerCanvas.ActualHeight));  
                                    dc.DrawRectangle(vb, null, new Rect(new Point(), bounds.Size));                                   
                              }                             
                              printDlg.PrintVisual(visual, "Workspace printout");
                        }
                        catch (Exception ex)
                        {
              
                        }
</code>;
GeneralRe: Changing text from white to black for printing Pin
Richard MacCutchan7-Sep-09 5:01
mveRichard MacCutchan7-Sep-09 5:01 
QuestionWPF Unit Test Problem Pin
Hauke Wittern6-Sep-09 22:59
Hauke Wittern6-Sep-09 22:59 
QuestionImages upload to SQL database Pin
Nekkantidivya6-Sep-09 22:06
Nekkantidivya6-Sep-09 22:06 
AnswerRe: Images upload to SQL database Pin
Arun Jacob6-Sep-09 22:19
Arun Jacob6-Sep-09 22:19 
AnswerRe: Images upload to SQL database Pin
Elayaraja Sambasivam7-Sep-09 2:28
Elayaraja Sambasivam7-Sep-09 2:28 
QuestionCatastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
Nekkantidivya6-Sep-09 21:57
Nekkantidivya6-Sep-09 21:57 
AnswerRe: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
Elayaraja Sambasivam7-Sep-09 2:38
Elayaraja Sambasivam7-Sep-09 2:38 
GeneralRe: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
almog.ori27-Jul-10 22:47
almog.ori27-Jul-10 22:47 
AnswerRe: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) Pin
Vimalsoft(Pty) Ltd26-May-11 0:30
professionalVimalsoft(Pty) Ltd26-May-11 0:30 
Questionbeginsavechanges help Pin
LT9996-Sep-09 21:06
LT9996-Sep-09 21:06 
QuestionStyling an AdornerLayer Pin
Etienne_1235-Sep-09 2:39
Etienne_1235-Sep-09 2:39 
AnswerRe: Styling an AdornerLayer Pin
Pete O'Hanlon5-Sep-09 3:15
mvePete O'Hanlon5-Sep-09 3:15 
Question3D model as Splash Pin
Etienne_1235-Sep-09 2:27
Etienne_1235-Sep-09 2:27 
AnswerRe: 3D model as Splash Pin
Pete O'Hanlon5-Sep-09 3:11
mvePete O'Hanlon5-Sep-09 3:11 
QuestionListView Expands Height But Doesn't Contract It Pin
AspDotNetDev4-Sep-09 13:37
protectorAspDotNetDev4-Sep-09 13:37 
GeneralWhy Does It Do That? [moved] Pin
#realJSOP4-Sep-09 0:07
professional#realJSOP4-Sep-09 0:07 
GeneralRe: Why Does It Do That? Pin
peterchen4-Sep-09 0:12
peterchen4-Sep-09 0:12 

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.