亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

WPF圖像控制上的鼠標處理

WPF圖像控制上的鼠標處理

C#
米琪卡哇伊 2021-08-22 15:40:44
我很菜鳥WPF。我創建一個WPF應用程序,使用EmguCV庫image Processing。我發現我不能ImageBox在WPF. 所以我用NamedWindow來顯示image然后我決定用Image Control來顯示window. 我想提請rectangle在那image,但矩形在其他地方沒有畫出。所以誰能告訴我代碼中有什么問題。基本上我想獲取該圖像的投資回報率。編輯:- 我把Canvas里面grid放了Image Control里面Canvas**我的 XAML 代碼 **<Grid Margin="0,0,2,-1">    <Grid.ColumnDefinitions>        <ColumnDefinition Width="138*"/>        <ColumnDefinition Width="139*"/>    </Grid.ColumnDefinitions>    <Button x:Name="button" Content="Convert" Margin="139.053,432.066,0,0" Click="button_Click" Height="27.934" VerticalAlignment="Top" HorizontalAlignment="Left" Width="113.947" Grid.Column="1"/>    <Button x:Name="button1" Content="Load Palette" Margin="308,432.066,0,0" Click="button1_Click_1" Height="27.934" VerticalAlignment="Top" HorizontalAlignment="Left" Width="75" Grid.ColumnSpan="2"/>    <Button x:Name="button2" Content="Load Gray Image" Margin="48,432.066,0,0" Click="button2_Click" Height="27.934" VerticalAlignment="Top" HorizontalAlignment="Left" Width="104"/>    <Canvas x:Name="MyCanvas" Margin="81,86.5,27.245,120.5" Grid.Column="1">        <Image x:Name="image3" Height="263" Width="238"/>    </Canvas>    <Image x:Name="image1" HorizontalAlignment="Left" Height="263" Margin="10,86.5,0,0" VerticalAlignment="Top" Width="255.5"/>    <Image x:Name="image2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Height="393" Margin="308,10,0,0" VerticalAlignment="Top" Width="75"/></Grid>我使用Event Handler過Canvas,但它不顯示rectangle提前致謝
查看完整描述

1 回答

?
千萬里不及你

TA貢獻1784條經驗 獲得超9個贊

我得到了答案,實際上我還沒有添加事件處理程序,image3 Image Control這就是它不顯示輸出的原因。


<Canvas x:Name="MyCanvas" Margin="81,86.5,27.245,120.5" Grid.Column="1">

    <Image x:Name="image3" Height="263" Width="238" MouseLeftButtonDown="image3_MouseLeftButtonDown" MouseLeftButtonUp="image3_MouseLeftButtonUp" MouseMove="image3_MouseMove"/>

</Canvas>


查看完整回答
反對 回復 2021-08-22
  • 1 回答
  • 0 關注
  • 176 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號