我想在设计时使用黄色背景进行用户控制.设计后应保持透明.我试图使用"忽略"标志,但无法理解它是如何工作的.
<UserControl x:Class="Abnehmen_Standard.ucRoundButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="84" d:DesignWidth="84"
d:Background="Yellow"
Run Code Online (Sandbox Code Playgroud)
最后一行不起作用.
你能建议我吗?
我需要在Windows 10 UWP应用程序中暂停一下.
我唯一想要的是等待5秒钟来完成下一个动作.我试过Task.睡觉但按下的按钮被冻结了......
暂停应该在这里:
loading.IsActive = true;
//int period = 5000;
//ThreadPoolTimer PeriodicTimer =
//ThreadPoolTimer.CreatePeriodicTimer(TimeSpan.FromMilliseconds(period));
loading.IsActive = false;
Run Code Online (Sandbox Code Playgroud)
如何暂停5秒?
我在.Net 4.0中的WPF工作.我有一些相机1392x1040像素的巨大图像.每个帧都会出现,System.Drawing.Bitmap并将通过使用转换为BitmapImage
Public Function BitmapToWpfBitmapSource(ByVal bmSrc As System.Drawing.Bitmap) As BitmapSource
If bmSrc Is Nothing Then Return Nothing
Dim res As BitmapSource
Dim Ptr As IntPtr
Ptr = bmSrc.GetHbitmap(System.Drawing.Color.Black) 'Create GDI bitmap object
res = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(Ptr, IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(bmSrc.Width, bmSrc.Height))
Dim ret As Integer = DeleteObject(Ptr) 'Delete GDI bitmap object
GC.Collect() 'Because the code is not managed, we need to call the collector manually to avoid memory spikes
Return res
End Function
Run Code Online (Sandbox Code Playgroud)
如果我在GUI中更新图像,我可以获得大约7帧/秒.
通过降低质量可以提高速度:
RenderOptions.SetBitmapScalingMode(Me.ucWindow1.VideoPresenter1.img1, BitmapScalingMode.NearestNeighbor)
使用线程更新每一帧
Dim …
我正在读这样的WPF图像源:
VB
Dim bmi As BitmapImage = New BitmapImage
bmi.BeginInit
bmi.CacheOption = BitmapCacheOption.None
bmi.CreateOptions = BitmapCreateOptions.IgnoreImageCache
bmi.UriSource = New Uri(input.FullName, UriKind.Absolute)
bmi.EndInit
Run Code Online (Sandbox Code Playgroud)
C#
BitmapImage bmi = new BitmapImage();
bmi.BeginInit();
bmi.CacheOption = BitmapCacheOption.None;
bmi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bmi.UriSource = new Uri(input.FullName, UriKind.Absolute);
bmi.EndInit();
Run Code Online (Sandbox Code Playgroud)
到目前为止,它的工作方式应该如此.但是用户可以通过复制文件来更新图像.然后我想刷新图像.但是文件"MyFileName"被锁定,当我想要覆盖它时,它会抛出一个错误,它已经被使用并被锁定.
但是等等,我在这里寻找解决方案,我得到了它:
bmi.cachoption = OnLoad
Run Code Online (Sandbox Code Playgroud)
是关键...但是!现在,图像始终是旧图像,并且不会更新到新文件.如何清除此缓存?
在VB.Net中,我从流中创建了一个System.Drawing.Bitmap.如何在WPF中做到最好?
问候
我有一个用户控件.我有时会再遇到这种情况,但可以通过使用" New()contructor" 来解决它.但是我仍然想知道我做错了什么因为如果加载了控件就必须触发load事件!
这是一些代码:
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:OUTPUT___VideoContent"
Title="OUTPUT - VideoContent" Height="350" Width="525" Icon="/OUTPUT%20-%20VideoContent;component/Images/VideoContent.png">
<Grid x:Name="LayoutRoot">
<Grid x:Name="VideoGrid">
<my:ucVideoPresenter x:Name="VideoPresenter1"/>
<TextBlock x:Name="txtInfo" Visibility="Collapsed" />
</Grid>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
在usercontrol中,load事件在WPF上声明或代码发送没有任何成功!


我第一次使用AnkhSVN.在32Bit Visual Studio 2010教授它很棒.

x64 Systems上具有相同项目的相同安装不显示绿色挂钩或任何SVN选项.

它似乎没有安装,并显示所有像以前一样.重新安装具有相同的无法使用的效果.没有错误.
我不确定是不是因为x64系统.
任何想法如何工作?
我正在使用Streamgeometry绘制一个简单的箭头。现在我需要将箭头转到指定的角度。但是如何旋转这个几何体呢?
Dim pt1 As New Point(X1, Me.Y1) 'left point
Dim pt2 As New Point(_X2, Me.Y2) 'right point
Dim pt3 As New Point(_X2 + (HeadWidth * cost - HeadHeight * sint), Y2 + (HeadWidth * sint + HeadHeight * cost)) 'arrow line down
Dim pt4 As New Point(_X2 + (HeadWidth * cost + HeadHeight * sint), Y2 - (HeadHeight * cost - HeadWidth * sint)) 'arrow line up
context.BeginFigure(pt1, True, False)
context.LineTo(pt2, True, True)
context.LineTo(pt3, True, True)
context.LineTo(pt2, True, …Run Code Online (Sandbox Code Playgroud) MSDN说:
格式32bppPArgb
指定格式为每像素32位;每个 8 位用于 alpha、红色、绿色和蓝色分量。根据 alpha 分量,对红色、绿色和蓝色分量进行预乘。
这是否意味着 RGB 值已经相乘并且 A(Alpha)值不再实际使用?这是否意味着如果我使用 PARGB ImageFormat,就不可能再看到真正的透明度,因为 RGB 值已经相乘,或者这只是 GPU 的“做得很好”功能,用户(开发人员)不会感觉到任何差异如果是 R/G/B 结果?
问候
关键是,我需要转换为System.Drawing.Bitmap(.Net Framework 2.0)以获取WPF Grid的单帧及其内容.
我读到了VisualBrush,DrawingBrush但我无法想象它应该如何运作.
我可以将任何WPF BitmapSource转换成我的System.Drawing.Bitmap成功.但是如何BitmapSource从我的网格接收?
谢谢
我看了一些项目,很高兴找到如何 增加真正的子文件夹 ,但没有任何解决方案让我看到在我的子文件夹中的文件.一切都回来了.


我已经尝试过pathForResource和URLforResource以及inDirectory方法.
//NSString *W = [[NSBundle mainBundle] pathForResource:@"LS_ADINFO_0000_LFSB" ofType:@"xml" inDirectory:@"/2012-03-08%20(Published%20as%2008%20MAR%202012)/AERODROMES/LFSB/"];
//urlPDF = [NSURL URLWithString:W];
// DEBUG output: urlPDF = nil
//urlPDF = [[NSBundle mainBundle] URLForResource:@"LFSB/LS_ADINFO_0000_LFSB.xml" withExtension:nil];
// DEBUG output: urlPDF = nil
//urlPDF = [[NSBundle mainBundle] URLForResource:@"LS_ADINFO_0000_LFSB.xml" withExtension:nil];
// DEBUG output: urlPDF = file://localhost/Users/siri/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/1F5953CD-1E13-40D4-9497-8313F9DDEA77/SwissVfrm03.app/LS_ADINFO_0000_LFSB.xml
Run Code Online (Sandbox Code Playgroud)
如何在XCode中设置子目录以便在iPad App中访问?
wpf ×6
.net ×3
c# ×2
graphics ×2
image ×2
performance ×2
64-bit ×1
ankhsvn ×1
bitmapsource ×1
code-behind ×1
countdown ×1
directory ×1
drawing ×1
events ×1
file ×1
filesystems ×1
geometry ×1
ipad ×1
iphone ×1
load ×1
locked ×1
msdn ×1
path ×1
pause ×1
svn ×1
uwp ×1
visualbrush ×1
x86 ×1
xaml ×1
xcode ×1