I am writing a Windows Phone Application in C# and on my application page i have an image object that is currently filled with an image. However i have another image object on the same page as well as a button object. What i want to do it click the button, and once i have done so i want to copy the image from the filled image object and paste it into the blank object.
Is there a way of doing this, i read something about the use of a bitmap to do so but i'm not sure how to do it? Any examples or ideas of what code i could use would be greatly appreciated.
You can remember Image.Source and pass that to the other page and set it as a source for another image control.
It also depends on how you are filling the first Image control. If you are in the control of filling both controls, then you can just as easy use the same code to fill both controls.
Related
So I was using Telerik Framework and this is what is used when opening Image and pass to RadImageEditor. But my problem is that when I finished editing, I want to pass again the image to the PictureBox and not save it to the Local.
What I used for passing the Image to RadImageEditor is this:
radImageEditor1.OpenImage((Bitmap)e.Data.GetData(typeof(Bitmap)));
Is there anyone who help me? Thank you
The save button on the toolbar fires an event that will give you the current image. You can invoke that with the client side API too
I'm a new developer trying to learn to develop for Windows 10 UWP and I've been struggling with the basics for days. I'm just trying to figure out how to change XAML properties using C#, in particular I'd like to change the source of an image so that clicking a button will change the image displayed. I'm used to javascript and jQuery which make this process absolutely painless ($("#elementID").attr("src", "Images/NameOfFile.PNG");). How do I do this for a UWP app? It seems like data binding is similar but I'm having a lot of difficulty understanding it and can't imagine that doing something so simple would have to be so difficult. Can you help me with this? Thanks!
The most simple way (without data binding) is to directly access the Image control in code behind. Give the control a name
<Image x:Name="image"/>
and set its Source property in code behind, e.g. in a Button Click handler
image.Source = new BitmapImage(new Uri("ms-appx:///Images/NameOfFile.png"));
where NameOfFile.png must be added to a folder named Images in your Visual Studio project.
See class Uri for details about the ms-appx:// scheme.
I need to use a blinking icon as an image for a specific item in a tree view. For this, i tried to add an animated gif file including two frames, one including the image and one an empty frame. I could add the image to the image list in designer. But it doesn't blink. I tried to figure out what's the problem, but i couldn't.
Any idea?
Default Windows Form does not support any animation, that's why gif file look like static image, when we use it in windows forms. If you are using windows form, then use timer control to redraw the treeview. Or use integrated wpf content in windows form(my choice)
I have an application for the windows store that I need to make emulate the tabs like Internet Explorer. The problem is that I have one control and it won't load into both the AppBar and the main view.
Is there a way to setup the CacheMode in the constructor of the control and then pull a bitmap from the BitmapCache and load that in the tab view in the AppBar? Or am I going about this the wrong way. I don't want to use two different controls due to it being a hack I want this to work with one control.
I am writing this application in C# and XAML.
Any help is appreciated.
A control can only have one parent in all popular XAML technologies, so you can't put it in two places.
You can use RenderTargetBitmap to take a screenshot of a control and put it elsewhere in your layout, but there are plenty of problems with that
It uses additional memory to store the bitmap
You need to figure out when to take that screenshot - typically after all images load and after every layout or content update.
A bitmap is not interactive.
Your best bet might really be to have two copies of the same control. You can create a UserControl to encapsulate any functionality and properties and reuse that control in multiple places easily. If you reference an image by URI - the platform should automatically share the resources for the image used in multiple controls.
Similar question:
convert windows form to pdf file
I am trying to print a Windows form to PDF in a similar manner as the above question, however the method described in that particular answer is essentially taking an image of the form. I have controls that use a scrollbar (e.g. tablelayoutpanel) and need to see all of the information within, rather than whatever selection the scrollbar happens to be on.
Is this possible?
You will need to take a screen shot and use that image to generate a pdf.
The only way I have seen this done is using a program called Snagit, which scrolls the application window automatically whilst capturing it and I assume stitches that together.
I would imagine you would need to do that programatically to get the output you need?