|
I've been using that code since version 3.0 and never had a problem.
I would suggest getting the demo to work first on your system, then build your program like the demo, then move to a code only solution once you digest all the pieces.
Dumb quesion: You are using VISTA and have Aero turned on, right?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Yes , I'm using Vista with Aero turned on , and I also checked DwmCompositionIsEnable(). According to the book I'm reading (Pro WPF in 2008 by Matthew Donald) the client area should be transparent , I have confirmed it on my friend's PC , but on my own machine , the client area became black , I don't know what's wrong here , I can't follow the tutorial correctly
|
|
|
|
|
|
That is the tutorial I was talking about , I followed it line by line but the result was different from the tutorial , my client area became black , I want it to be transparent
|
|
|
|
|
Not really sure what the issue could be. I assume that you can't get the demo application to work, right? But the demo application works on other machines?
If so, step though the code on both systems and see where things get off track.
Are the EXACT builds and service packs applied?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
|
We are developing a DVD application with the help of D3DInterop, DirectShow API and WPF. In this application we are trying to add all the functionalities that can be carried out with a normal DVD player. We have faced some problem during the development stage. The problems we faced are listed below for your kind information:
1. Audio is not functioning. Did we miss any audio filters?
2. The navigation menus of DVD disc (Eg: language selection, scene selection, song selection) are working through keydown event. But the same are not working with mouse events (Like, mouse move, mouse down etc.).
We couldn’t find out any solution for this problem. We hope there will be a solution this. Looking for a positive response to the earliest.
|
|
|
|
|
Tell me...
What on God's green earth does this have to do with Windows Presentation Foundation, Windows Communication Foundation or Windows Workflow Foundation?
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
I'm having this weird minor problem that I can't seem to figure out, probably because I don't understand enough of why it's happening.
I have an ImageDrawing that I draw some shapes in, and then animate those shapes. Due to the animation, the size of the drawing changes, as do its edges relative to the "center" of the drawing, if you will, (or any fixed point in the drawing).
What's happening is WPF is treating the image as an encapsulated object whose dimensions keep changing, resulting in it constantly "re-centering" itself, which results in my drawing moving around on the window when I want it to be completely fixed (so that the individual shapes animate, but the drawing as a whole stays in the same spot).
Basically as far as I can tell is happening is the drawing is being "trimmed" (like in Photoshop), rather than staying a fixed size like a canvas. Any idea how to stop this happening?
I've tried a few things like giving the Image a fixed width and height, but the drawing inside it still does the same trimming thing. Also I can't set HorizontalAlignment or VerticalAlignment because the top/bottom and left/right edges of the drawing still change (thanks again to the trimming).
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
I suppose I could put some invisible rectangle large enough to cover the area, but there must be a better way...
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Well I changed things around to use Line objects on a Canvas instead of LineGeometry's in an ImageDrawing and now I'm not having that problem.
Not sure if I will incur a performance penalty doing it this way, but it seems a lot easier, and besides, it will allow me to do other things I was wanting to do (such as change opacity of individual pieces of the drawing) that I didn't realize weren't possible doing it the other way, so I think I'll stick with this.
One more question for anyone who happens to be paying attention:
It seems rather cumbersome to have to declare the stroke color, stroke thickness, start cap and end cap for every single Line object I create. It would be much handier if I could group these under some logical parent, and attach those properties once to the parent, and have them inherited by each child Line.
In fact, I thought this was the whole point of attached properties, yet when I try to attach Shape.StrokeThickness (for example) to Canvas, I get an error that it can't find the attachable property.
Is there some other way to achieve the same thing?
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Oh wait, duh, I know the answer to that: styles!
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
I need to create an application that will display the output of a Surveillance System.
What I need to do is having three layers of image (can be zoom in and out). The user will zoom the first layer until max and enter the second layer and so on. Each of this layer of image, I will need to draw points of where the activity has occurred. And each of this point is clickable and will pop up a new window.
Anybody has a general idea on how to achieve this in WPF?
I am very new to WPF and hope that somebody could help me on this.
|
|
|
|
|
Not sure what you mean by your zooming scenario (what do you mean "enter the second layer"?), but it's easy enough to draw vector shapes on-top of an image using either a Grid or Canvas since both of those support multiple children. A Grid is probably your best bet as it's more flexible, yet simple to use as a single-cell:
(I'm using ['s instead of angle brackets)
[Grid]
[Image ... /]
[Ellipse ... /]
[/Grid]
If you want programmatic/declarative control over the layering order use ZIndex.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Hi chaiguy1337, Thanks for you help .. but what I need to do is a bit more complicated.
Let me explain the process flow here.
- In the user interface, I have to place a cctv image that will cover a room in a building. And this building has three floors.
- User could use the mouse scroller/ or a slider to zoom in and out of the image. User also can zoom in the first floor to second floor and so on.
-To add to the pain, I will have to do a vector drawing based on the parameter sent from the surveillance system.
-This drawing will plots the activities that has happen in the room. It could take the shape of rectangular, star and etc.
-This plots of point is clickable and when the user click on the plot, a new window will pop-up showing the exact time frame the activities has happen.
My project manager also suggested it has to be done some what like a 3D scene. While zooming, some effect like fade before entering the second floor will take place.
I have no idea how to do that. Help..
|
|
|
|
|
You should be able to produce a live feed into a "visual" element that sits in your window. The vector drawing should not be hard via Shape-derived objects (rectangle, line, polygon, etc.) and come with hit-testing built-in so you can just subscribe to a MouseDown on the shape object (you can draw the shape directly on top of the video feed via Canvas). Presumably you will draw the shape based on those parameters you receive.
(For bonus points, you could even animate them between frames--I bet your manager would be impressed with that! Then again if the framerate is high enough there would be no point.)
I'm afraid I have no idea what you mean about a 3D scene, or "entering" the second floor, however fading is quite easy in WPF by animating the opacity of an element. You could, for example, have two video feed visuals and fade one out as the other fades in.
Hope this helps,
Logan
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Hi
just got a copy of blend and have been trying to figure out what the design process is for building an application using visual studio 2005 and blend, basically the videos I have have been great at showing what you can do, but nothing about using blend with windows forms, how the hell do I apply designs done for user interface to a windows form. I am very used to build everything in visual studio and build all my code routines and functionality in VS, now blend looks like it lays the stuff out great but how do I view the elements built in blend on a windows form.
Any suggested walkthroughs for building a simple application in visual studio and using ui elements created in blend and then linking buttonclick events to code would be greatly appreciated, I have been trawling the internet and havent found anything of use yet.
Thanks
|
|
|
|
|
Note: This forum is for Silverlight questions only.
Why don't you develop WPF if you are using winform.
|
|
|
|
|
Hi everybody.
this is my code :
System.Timers.Timer aTimer = new
System.Timers.Timer(1000);
public Window1()
{
InitializeComponent();
aTimer.Elapsed += new
System.Timers.ElapsedEventHandler
(aTimer_Elapsed);
aTimer.Enabled = true;
}
void aTimer_Elapsed(object sender,
System.Timers.ElapsedEventArgs e)
{
secondHand.Angle = DateTime.Now.Second * 6;
}
and this is my XAML code :
<Rectangle Margin="150,0,149,150"
Name="rectangleSecond" Stroke="White"
Height="120" VerticalAlignment="Bottom"
><Rectangle.RenderTransform>
<RotateTransform x:Name="secondHand"
CenterX="0" CenterY="120"
Angle="0" />
</Rectangle.RenderTransform>
</Rectangle>
But there is an exception in it !
The calling thread cannot access this object because a different
thread owns it.
How can I solve it ?
Thanks in advance.
|
|
|
|
|
|
Thank you Insincere Dave.
I found it here[^]
|
|
|
|
|
Hi,
I want to show the multiple attribute values of a node from XML file to treeview...
So please help me to fetch the multiple attribute values of the following XML file....
<Sections>
<Web>
<Site site="Public Site" category="CORE" >
<Search>
<Parameter name="State" value="" type="SelectList"/>
<Parameter name="zipcode" value="" type="TextField"/>
</Search>
</Site>
</Web>
</Sections>
from this file i want to bind this XMl file to tree view and i want show all node,attributes and its values like name,value,type etc......
Can anybody help ASAP.....
|
|
|
|
|
You could always code up something like this:
<Window x:Class="WpfTreeview.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<DataTemplate x:Key="NodeTemplate">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding XPath=@name}" />
<TextBlock Text=" : " />
<TextBlock Text="{Binding XPath=@type}" />
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<TreeView Name="treeView1" ItemTemplate="{StaticResource NodeTemplate}" />
</Grid>
</Window>
|
|
|
|
|
Can any one help
I have tried, Create one Custom Control using Custom Control(WPF) in visual studio 2005 and .net 3.0,
MyCustomButton
ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyCustomButton"
but I got the default error and can not open the Design Page.
Error: Assembly '' was not found. The 'clr-namespace' URI refers to an assembly that is not referenced by the project.
|
|
|
|
|
Either MyCustomButton is in an external reference which you need to add into your project and reference using the assembly syntax at the end or, if the button is in your project, it hasn't successfully built - and so, won't appear.
|
|
|
|