|
It may not be.....I'm just starting with this cause that's what we developed it in. We are using the System.Media.Imaging Namespaces...we tried to use the dll from composer but we ran into Memory issues...so now we're using this...we are using transformed and cropped bitmap to create the tiles....any ideas?
|
|
|
|
|
Reading your post again I now see "create my own version of the deep zoom composer"...
sorry about that.
Anyway - I'm not being facetious here, but if tiles you create are coming out black, then
isn't something wrong with the code creating the tiles?
Any help from the debugger when that level's tiles is being created?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
No worries....and believe me I've looked and I would think that it would be the code, however it only happens on the second tile level...all other levels are good...
|
|
|
|
|
How are you verifying the tiles for that level are black?
Is the folder for the level in question created properly?
If so, is there tile files in there?
If so, if you look at the tile files they are black? Are they the right dimensions?
If you are creating the tiles without using the DeepZoom composer from MS,
then it is the code that's not working. WPF doesn't know anything about Deep Zoom
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
To verify the tiles are black we are bringing them up in a tilehandler that we are using for the viewer page.
We are creating the tiles dynamically and loading them into the db....and they are the correct dimensions....
Here's a little more background:
basically the application gets an image, converts it from .tiff to .png and then dynamically splits it into tiles and upload the tiles into the DB. The problem is the second level does not seem to be working correctly and I'm confused as to why when the level before and all levels after work fine?
I appreciate your help...it helps to think about other issues that it could be.
|
|
|
|
|
It's obviously an issue in your code. Have you installed a debug visualiser for bitmaps, and stepped through the code to see if they are black at the point of creation ? Or just added code to save them locally, pull them out of the DB and save them again, to see if the DB layer is the issue ? You have to cut the task into pieces to see which bit is breaking, and you need to seperate the images from your code for viewing, to make sure the viewer is not the issue, somehow.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian,
Thanks for your reply...I don't think it's an issue with the viewer because it worked before...we had to change the code becasue we kept getting out of memory exceptions with the system.drawing stuff so we had to go to system.media.imaging (I think that's what it is) and we don't get the memory issue anymore. But the view worked perfectly for those images...I will look into the things you have suggested....
Thanks again
Chris
|
|
|
|
|
I would like to bind a MenuItem.IsChecked property to another using the FindAncestor approach. The problem I have is that the binding fails since the MenuItem is not in the same visual tree as it's ancestor due to (I think) the way it is created.
See http://munkiisoft.com/blog/archive/2007/02/01/binding-contextmenu-to-its-logical-parent.aspx as an example however my problem cannot be solved using this approach sine the ancestor is not the PlacementTarget.
Any ideas in how to how I can achieve this without I guess creating my own markup extension??????
Just in case the Xaml is shown below, nothing (I think again) is wrong here.
<MenuItem IsCheckable="True" x:Name="verticalRuler" Header="Vertical ruler" IsChecked="{Binding Path=VerticalRulerVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type demo:demoBox}}, Mode=TwoWay}"/>
The error:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Demo.DemoBox', AncestorLevel='1''. BindingExpression:Path=VerticalRulerVisible; DataItem=null; target element is 'MenuItem' (Name=verticalRuler); target property is 'IsChecked' (type 'Boolean')
Thanks in advance. . .
|
|
|
|
|
You could always use the ElementName to achieve this effect instead,e.g.
<MenuItem IsCheckable="True" x:Name="verticalRuler"
Header="Vertical ruler" IsChecked="{Binding ElementName=... Path=VerticalRulerVisible}, Mode=TwoWay}"/>
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks for the reply but it's a little trickier than that since the source is not in the same template therefore I can't use ElementName, I have no choice but to use the FindAncestor approach which doesn't work.
Any other ideas?
|
|
|
|
|
Before we go any further with this, have you verified that the elements are in different visual trees? You can do this using snoop[^]. If you want to check hierarchies and bindings, this tool is invaluable.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I presume the MenuItem belongs to a Context menu.
Bind using Context menu as Source and then use the PlacementTarget to reach the element you need.
Try something like this,
<Button Tag="{Binding RelativeSource={RelativeSource AncestorType={x:Type demo:demoBox}}}">
<Button.ContextMenu>
<ContextMenu>
<MenuItem IsChecked="{Binding Path=PlacementTarget.Tag.VerticalRulerVisible, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}"></MenuItem>
</ContextMenu>
</Button.ContextMenu>
</Button>
|
|
|
|
|
A bit smart indeed, nice one thanks I'll give it a try.
|
|
|
|
|
Hi,
I am working on WPF stack panel. In this I am dynamically adding images to the stack panel. While displaying the images i the stack panel all the images are displayed continously without any space between them. But I want to display the images with some space to separate them. That is I want to get some space between each item of the stack panel.
If anyone have any idea on this please reply me. Please note that I am adding children to the stack panel dynamically at run time.
Thanks in Advance
|
|
|
|
|
Set an appropriate Margin[^] to the image controls you add.
|
|
|
|
|
I have a Grid that is resizable via a storyboard animation. The user can turn off animations if he chooses to do so. If animations are turned off by the user, the grid is resized by directly manipulating the height property.
The problem: After using the animation to resize, the height property appears to reject manual setting of a given value. In other words, the following line is executed, but the math being performed is ignored:
myGrid.Height += someValue;
If I change the resizing mode to non-animated BEFORE resizing the grid, it works as expected. Once I resize with the storyboard, though, mannual resizing doesn't work.
I also tried changing the duration of the animator to 0.0, and that doesn't resize the grid either.
EDIT - I also tried changing the FillBehavior property.
"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
|
|
|
|
|
Maybe off topic, but...
I wouldn't do math like that using the Height property. Height is a suggested
height and reading its value isn't usually useful.
Something like this may be more appropriate:
myGrid.Height = myGrid.ActualHeight + someValue;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'll give that a shot.
"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
|
|
|
|
|
Nope, that didn't work either.
"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
|
|
|
|
|
I think the problem is that the animation interferes with your setting. You set your storyboard to null, in order to stop it taking hold of stuff, from memory, or perhaps it's one of the properties on the storyboard you reset. It's something like that, to get the storyboard to let go of the control.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Would you call that a WPF bug? I certainly would. There's no reason it should keep hold of the property once it's done with the animation. I'll see if that fixes it when I get to work this morning.
On the other hand, I did try setting the duration to 0 on the storyboard and letting it do the resize, and it didn't work that way either. maybe I was just doing it wrong.
"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
|
|
|
|
|
I do recall that we had to set some attached property to null when we wanted to set stuff manually. Is it a bug ? I don't think so, it's more a quirk. There's plenty of other stuff in WPF that far better qualifes as a bug, IMO.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I tried that, and it still doesn't work.
Grrrr...
"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
|
|
|
|
|
I'm sorry, I've spoken to Nish and we agree that this is the solution. The dependency properties give higher priority to the storyboard than a manual property. However, we don't have to do that in our code base anymore, so I can't find an example. I'm sorry I can't help more, it's my recollection we set a property to null on the storyboard to release the property from it, but I can't figure out what it was.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Well, I tried this:
Storyboard.SetTarget(MyAnimator, null);
And it still doesn't have any effect.
I also tried setting the TargetName and TargetProperty to null , but the framework won't even allow me to do that.
I also set the FillBehaviour to Stop , and that also had no effect.
No matter what I do, if I animate the re-size and then try to set it for non-animated re-sizing, the animated control will NOT let me programatically change the Height property.
"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
|
|
|
|