|
I tried sending WM_PAINT to the window but I only got the border without the content. Looks like WPF windows do not respond to WM_PAINT properly and there is no built-in method to draw non-client area. Try to get the non-client area and the client area and compose into a single bitmap. Or maybe you should look into this DWM Thumbnail Overview[^].
Eslam Afifi
|
|
|
|
|
Eslam Afifi wrote: I tried sending WM_PAINT to the window but I only got the border without the content.
What I do know is that WPF & GDI+ work in two seperate worlds... WPF draws in DirectX space...
I'd be interested in looking at it. I've got the code to capture the elements and you've got the code to capture the non-client area. Tying the two techniques together is a near enough hack to solve my problem.
Would you mind?
Does someone else have a cleaner way of doing it?
|
|
|
|
|
Private Const WM_PRINT As Integer = &H317
Private Const PRF_NON_CLIENT As Integer = &H2
Private Const PRF_CLIENT As Integer = &H4
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As IntPtr, _
ByVal Msg As Integer, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Public Sub DrawToBitmap(ByVal hWnd As IntPtr, ByVal bitmap As System.Drawing.Bitmap, _
ByVal targetBounds As System.Drawing.Rectangle)
If (bitmap Is Nothing) Then Throw New ArgumentNullException("bitmap")
If (((targetBounds.Width <= 0) OrElse (targetBounds.Height <= 0)) _
OrElse ((targetBounds.X < 0) OrElse (targetBounds.Y < 0))) Then _
Throw New ArgumentException("targetBounds")
Using graphics = System.Drawing.Graphics.FromImage(bitmap)
Dim hDC = graphics.GetHdc()
SendMessage(hWnd, WM_PRINT, hDC.ToInt32(), PRF_CLIENT + PRF_NON_CLIENT)
graphics.ReleaseHdc(hDC)
End Using
End Sub
But you'll have to get the exact width and height of the window in case the window is maximized.
Althought WPF uses DirectX, I think they could have made WM_Print work by composing the client and non-client bitmaps the same way you would do with the code.
Eslam Afifi
|
|
|
|
|
Hello Team,
Need an urgent help. Requirement seems simple. But me new to WPF.
Say I have three PNG files displayed with Close,Minimise and Maximise buttons for each PNG. If one of the PNG is closed, the other two should resize and occupy the space.
Please assistance ASAP.
Thanks in advance
Newtodev
|
|
|
|
|
Are there any issues with using a WPF Browser Application with WCF as I was reading something about issues with WSDualHttpBinding. If this is the case is the best way around it to have use BasicHttpBinding or WSHttpBinding and don't use callbacks.
Cheers for your view / help with this.
Some people are like slinky's... They're not really good for anything but they bring a smile to your face when pushed down the stairs
|
|
|
|
|
Hello guys! I need to have different context menus in my datagrid - one for its header and one for rows of a grid. So I'm handling MouseClick event and than I need to evaluate if the underlying object for mouse cursor is Datagrid's header. Can you explain me how can I make this? The thing that I can't understand is that neither of DataGrid's and DataGridColumn's hierarchy of objects contain DataGridColumnHeader object or any reference to it. But in virtual tree if I get textblock that is located in header and contains column header's text and then get it parent container, I'll get DatagridColumnHeader object.
Any help is appreciated. Thanks in advance!
|
|
|
|
|
You might have better luck getting a good answer over on the codeplex forum.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
How to deploy Silverlight application on IIS server?
|
|
|
|
|
Silverlight is a client-side technology - deploying to a server is
pretty much as simple as copying the xap file (and any related files) to
a folder accessible by the web server.
Do you have a more specific question?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please Give some easiest step to deploy the silver light project
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
I am using webservice and webreference in my project.
When i deploy and run the project it runs fine but it gives error where i called by the web service.
Thanks in advance.
|
|
|
|
|
I assume you are not pointing to localhost and you are using WCF services.
Probably you will have to create a host factory (that happened to me on the shared hosting where I have my app:
public class MyServiceHostFactory : MyServiceHostFactory
{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
// Specify the exact URL of your web service
Uri webServiceAddress = new Uri("http://www.mysite.com/myservice.svc");
ServiceHost webServiceHost = new ServiceHost(serviceType, webServiceAddress);
return webServiceHost;
}
How to use it, in the svc header:
<%@ ServiceHost Language="C#" Service="MyService" CodeBehind="MyService.svc.cs" Factory="MyServiceHostFactory"%>
In a separated post I send you trouble shooting links.
HTH
Braulio
/// -------------------------
Braulio Díez
DBSchemaEditor.com
Free Silverlight based DB Schema Modeling Tool
/// -------------------------
|
|
|
|
|
|
right click on server side application in your visual studio and click publish
then in your IIS server you create a virtual folder and give it the path of your deploy application.

|
|
|
|
|
Have anyone used Deepearth in Silverlight? If so, can you please give some instructions on how to show addresses in Deepearth?
Thanks,
Sam
|
|
|
|
|
|
Hi
I want to create a listbox or listview displaying various furniture parts such as "table leg" or "table top", and then I want to be able to click on these items, and then drag them onto a viewport, but soon as my mouse pointer enters the viewport, the application should generate a 3D model of a table leg or table top, and fix the model in place as soon as I release the mouse button. Similar to how MS Visio works.
Would this be possible? Any help will be appreciated!
|
|
|
|
|
|
Alrightie. As much as I hate WPF's unreasonable adoption for your typical desktop application, I actually want to write an app that has a viable need for WPF. Specifically, I'll be trying to implement some control animation and displaying graphics. To give you an idea of what I want to accomplish, check out Media Portal[^]. It has fancy control animation and displays graphics. My app will be a movie database of movies I own, and I want the interface to resemble the one used in Media Portal. I'm not necessarily interested in interfacing with Media Portal, I just want it to look kinda the same.
Any advice on where to start would be greatly appreciated.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
There is a sample application called photosuru photosuru for cataloging photos, it's interface is pretty good although its not like mediaportal/mediacenter. It is based around rss subscriptions instead of local storage but you may want to check out the source anyway.
I've looked for an app to do what you described but haven't found one I like. I also began writing one but lost interest. You way want to look at some existing ones for ideas perhaps Delicious Library (Mac) and Revolución (Java, not out yet).
I haven't used any of those composite application libraries perhaps someone else could recommend them if they're appropriate for this type of app?
|
|
|
|
|
Hi John, just incase you haven't taken a look at Sacha's Sonic[^] and Geoplaces[^] articles. They are really cool.
Also, take a look at this post on fancy cutom layouts[^]
Hope this helps :>
|
|
|
|
|
John Simmons / outlaw programmer wrote: Any advice
I have kind of hesitated to comment here but for what it's worth:
Try real hard to find something to use to create the actual UI other than using VS. VS is fine for the coding part but for visual designing a WPF UI, it's disappointing.
Line up some WPF resources before hand so you know where you can go for some specific issue. Some places specialize in the graphics portion and some in animation.
Other than that, nothing very specific. Like any other project, decide what you are going to do and how you are going to do it.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
What helped me was figuring out what 'cool things' I wanted to accomplish in my app and then spending some time doing proof of concept designs in a small isolated environment so I could see the effect I wanted in some uncluttered xaml, free of all the other application stuff that would normally be there.
I also second the other comment about using a design tool like the Expression suite to do the graphics work. Although VS is (IMHO) a good development environment, it sucks for doing anything graphical and remotely 'artsy'. You will only get frustrated. Get a copy of the Expression suite to play with to do your design in and keep VS for editing code.
AT least that was my experience with Silverlight. I have not done tons of straight WPF stuff yet, but I assume the experience would be the same.
|
|
|
|
|
Hi.
How can we use LINQ to XML in SilverLight 2 ?
Thanks.
|
|
|
|
|