Allow copying graph as image (#1051)
This commit is contained in:
@@ -476,7 +476,15 @@
|
||||
LostFocus="GraphingControl_LostFocus"
|
||||
RequestedTheme="Light"
|
||||
UseSystemFocusVisuals="True"
|
||||
VariablesUpdated="GraphingControl_VariablesUpdated"/>
|
||||
VariablesUpdated="GraphingControl_VariablesUpdated">
|
||||
<graphControl:Grapher.ContextFlyout>
|
||||
<MenuFlyout Placement="Bottom">
|
||||
<MenuFlyoutItem x:Uid="GraphCopyMenuItem"
|
||||
Click="GraphMenuFlyoutItem_Click"
|
||||
Icon="Copy"/>
|
||||
</MenuFlyout>
|
||||
</graphControl:Grapher.ContextFlyout>
|
||||
</graphControl:Grapher>
|
||||
<Border MinHeight="36"
|
||||
Margin="0,12,12,0"
|
||||
HorizontalAlignment="Right"
|
||||
|
@@ -619,3 +619,13 @@ void GraphingCalculator::SetDefaultFocus()
|
||||
EquationInputAreaControl->Focus(::FocusState::Programmatic);
|
||||
}
|
||||
}
|
||||
|
||||
void GraphingCalculator::GraphMenuFlyoutItem_Click(Object ^ sender, RoutedEventArgs ^ e)
|
||||
{
|
||||
auto dataPackage = ref new DataPackage();
|
||||
dataPackage->RequestedOperation = ::DataPackageOperation::Copy;
|
||||
|
||||
auto bitmapStream = GraphingControl->GetGraphBitmapStream();
|
||||
dataPackage->SetBitmap(bitmapStream);
|
||||
::Clipboard::SetContent(dataPackage);
|
||||
}
|
||||
|
@@ -91,6 +91,7 @@ public ref class GraphingCalculator sealed : public Windows::UI::Xaml::Data::INo
|
||||
void Canvas_SizeChanged(Platform::Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
|
||||
void OnHighContrastChanged(Windows::UI::ViewManagement::AccessibilitySettings ^ sender, Platform::Object ^ args);
|
||||
void OnEquationFormatRequested(Platform::Object ^ sender, CalculatorApp::Controls::MathRichEditBoxFormatRequest ^ e);
|
||||
void GraphMenuFlyoutItem_Click(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user