Click here to Skip to main content
15,349,569 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Textbox border curve Pin
ABitSmart8-Apr-09 0:37
MemberABitSmart8-Apr-09 0:37 
QuestionSnapshot of a Form in a thumbnail Pin
Graeme_Grant6-Apr-09 23:57
professionalGraeme_Grant6-Apr-09 23:57 
AnswerRe: Snapshot of a Form in a thumbnail Pin
Christian Graus7-Apr-09 13:51
mveChristian Graus7-Apr-09 13:51 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant7-Apr-09 23:30
professionalGraeme_Grant7-Apr-09 23:30 
AnswerRe: Snapshot of a Form in a thumbnail Pin
Eslam Afifi7-Apr-09 15:56
MemberEslam Afifi7-Apr-09 15:56 
GeneralRe: Snapshot of a Form in a thumbnail [modified] Pin
Graeme_Grant7-Apr-09 23:32
professionalGraeme_Grant7-Apr-09 23:32 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant8-Apr-09 0:37
professionalGraeme_Grant8-Apr-09 0:37 
GeneralRe: Snapshot of a Form in a thumbnail [modified] Pin
Eslam Afifi8-Apr-09 8:24
MemberEslam Afifi8-Apr-09 8:24 
GraGra_33 wrote:
The only issue I have now is that only the contents of the form are captured and not the non-client area.


I'm thinking about accessing the Window as a Form, and call the DrawToBitmap. But I couldn't get it to work now and I don't know if it's possible. I have an exam tomorrow so I can't investigate it further right now. Maybe if there is some Win32 API that does take a snapshot of a window by handle, since we can access the handle.

' the code is not tested
Dim hlper As New System.Windows.Interop.WindowInteropHelper(Me)
Dim windowAsForm = System.Windows.Forms.Form.FromHandle(hlper.Handle) ' returns null, don't know why

Dim w = windowAsForm.Size.Width
Dim h = windowAsForm.Size.Height
Dim bitmap As New System.Drawing.Bitmap(w, h)
windowAsForm.DrawToBitmap(bitmap, New System.Drawing.Rectangle(0, 0, w, h))

' code from <a href="http://dedjo.blogspot.com/2007/05/how-to-use-systemdrawingbitmap-hbitmap.html">here</a>[<a href="http://dedjo.blogspot.com/2007/05/how-to-use-systemdrawingbitmap-hbitmap.html" target="_blank" title="New Window">^</a>], i didn't test it
Return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), _
                                                                    IntPtr.Zero, _
                                                                    Int32Rect.Empty, _
                                                                    System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions())


Eslam Afifi

modified on Wednesday, April 8, 2009 2:31 PM

GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant8-Apr-09 10:43
professionalGraeme_Grant8-Apr-09 10:43 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Eslam Afifi10-Apr-09 3:07
MemberEslam Afifi10-Apr-09 3:07 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant10-Apr-09 14:21
professionalGraeme_Grant10-Apr-09 14:21 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Eslam Afifi10-Apr-09 15:28
MemberEslam Afifi10-Apr-09 15:28 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant10-Apr-09 17:11
professionalGraeme_Grant10-Apr-09 17:11 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Eslam Afifi11-Apr-09 8:04
MemberEslam Afifi11-Apr-09 8:04 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Graeme_Grant11-Apr-09 12:03
professionalGraeme_Grant11-Apr-09 12:03 
GeneralRe: Snapshot of a Form in a thumbnail Pin
Eslam Afifi11-Apr-09 23:30
MemberEslam Afifi11-Apr-09 23:30 
QuestionWPF layout manager - resize,maximise minimise Pin
smita.si6-Apr-09 22:14
Membersmita.si6-Apr-09 22:14 
QuestionIssue's with WCF and WPF XBAP's Pin
Gretna6-Apr-09 21:42
MemberGretna6-Apr-09 21:42 
QuestionWPFtoolkit's DataGrid and DatagridColumnHeader Pin
wazzzuup6-Apr-09 11:10
Memberwazzzuup6-Apr-09 11:10 
AnswerRe: WPFtoolkit's DataGrid and DatagridColumnHeader Pin
Wes Aday7-Apr-09 8:05
professionalWes Aday7-Apr-09 8:05 
QuestionHow to deploy Silverlight application on IIS server? Pin
sumit70346-Apr-09 2:57
Membersumit70346-Apr-09 2:57 
AnswerRe: How to deploy Silverlight application on IIS server? Pin
Mark Salsbery6-Apr-09 6:28
MemberMark Salsbery6-Apr-09 6:28 
GeneralRe: How to deploy Silverlight application on IIS server? Pin
Piyush Vardhan Singh6-Apr-09 20:46
MemberPiyush Vardhan Singh6-Apr-09 20:46 
GeneralRe: How to deploy Silverlight application on IIS server? Pin
sumit70346-Apr-09 22:46
Membersumit70346-Apr-09 22:46 
GeneralRe: How to deploy Silverlight application on IIS server? Pin
Braulio Dez12-Apr-09 7:25
MemberBraulio Dez12-Apr-09 7:25 

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.