how to create custom labels in c# - c#

I've given a task to create a picture puzzle using c#. I have to customize a control to act like a tile. what I have in my mind is to create label to act as a puzzle tile. I have no experience in customizing a label control.. If any one can help me with a tutorial for this task It would be a great help.
I'm using windows forms for this project and not WPF.
I've googled but couldn't find any suitable tutorial. Please help me on this.
Thank you.
below is how each piece should look like in the application! A tile class is used to represent each puzzle piece.

The only way to manipulate the design structure of Windows Form controls is through the GDI (Graphics Device Interface). The device context is accessed through System.Drawing. This will allow you to inherit or override a control and create/alter its appearance. I worked with the GDI for about a month. It is not something that's learned overnight. As a quick alternative, you may consider adding puzzle pictures to a button control and coding it up so that if button A is within xx pixels of button B's left edge then A&B background image = a connected picture. Or something along those lines.
http://www.codeproject.com/Articles/6913/Creating-a-professional-looking-GDI-drawn-custom-c

Related

Draw on Video Xamarin

Using Xamarin, I am trying to implement the feature that allows a user to draw on top of a video. Note that the drawing doesn't need to be saved.
I would like some input on what the best way of implementing this. My initial though would be to create a drawable custom view that when the user clicks the draw icon, the current frame of the video is passed to that drawable view.
This seems like a pretty great plugin, which I could use to create a custom view https://github.com/martijn00/XamarinMediaManager.
Would really appreciate any help or suggestions :)

How to create interactive graphics with WPF?

I wonder how I can code an application that allows the user to handle simple graphic objects like in a vector graphics program. As a starting point I would like to have a program which allows the user to draw some rectangles, select them with the mouse and move them around.
I have some base knowledge in WinForms but it seems that WPF is a better choice for this task (tell me if you think different. I wouldn't mind using a free graphics library for Winforms as alternative).
I think I know hot to draw a rectangle and how to find out which rectange was clicked by the user. But I don't know how to move the rectangle around with the mouse. Can you give me a hint? I had a look into animations where I could move the rectanle around programatically but I am not sure whether this is the right way to implement it for mouse control.
You might want to have a look into PathGeometry. Check this link.
Combined with a Canvas and some controls you can make a pretty nitty editor ;)
Hope this helps.

Create an Object Editor in C# for WinForms

I need to find, or create an editor that will handle text and images as objects. For instance I have a 3 line string of text, to be able to move it around and position it within a canvas, also the ability to add an image, and possibly resize it within that canvas. and take the result, and save it, whether I get the the offsets and positions manually, of each of the objects (preferable) , or get the entire canvas as an image, to be able to save and print.
Rulers would be great... Im not trying to re-create Photoshop, but the idea is similar.
I will be doing this in a C# WinForms application, it does seem however that a WPF solution might be better suited, and I think I can have a WPF control within winforms...
Any direction or advice would be greatly appreciated.
Forget winforms. It doesn't support anything. Your best bet is to do it in WPF and if you need, you can integrate it into an existing winforms application via the ElementHost.
Please see my similar answers/samples about this:
https://stackoverflow.com/a/15580293/643085
https://stackoverflow.com/a/15469477/643085
https://stackoverflow.com/a/15821573/643085
Also, see this example with support for zoom, panning and resizing functionality:
https://stackoverflow.com/a/16947081/643085
They're all MVVM based and have some interesting features.
You can easily customize these samples and add ANY type of elements:
images,
geometries,
usable interactive UI elements with functionality (TextBoxes, ComboBoxes, whatever),
text,
videos,
FlowDocuments,
or whatever that's visible on screen)
by adding additional data items and their corresponding DataTemplates.

Render Tube and resize, dynamically add text

What I am looking to do in my Windows Forms application (or even WPF). Is to dynamically render an image of a tube, or cylinder (with a 3d look or having some sort of depth for a better visual experience), setting the length and hieght and so on, (also need rulers and such to zoom in and out). But then allow the user to enter some text, which will then be placed on that tube or cylinder, for display purposes, able to scale the text size, to create a visual representation of what it would look like IRL.
Any ideas on where I can start, or some examples I can build off of? This vector type display is new to me, so any help would be appreciated.
This article looked interesting. I would imagine you could tweak it to do what you were after.
http://kindohm.com/technical/WPF3DTutorial.htm
Also I googled "WPF 3D drawing".
If you have the choice WPF is better suited for graphics than WinForms out of the box. Though a good programmer can make WinForms do similar.

C# - Winforms - Animated Slideshow

Well i am developing an application whose interface requires an animated slide show
and by animated slide show i means UI components placed together change their positions after regular intervals in a sliding (animated) fashion. Let me illustrate my idea with the following image,
(source: deviantart.com)
in the image above there are three columns of UI components that i want to slide, what i could do is simply write a module to change x,y coordinates of the components that would give the animated slide effect but that does not work fine, because it is heave takes time in processing and all plus the coding will be complex and layer adjustment and all.
is there any slide show component on which instead of image i can place UI components
What are the other options i have or what is the right way to do it. Please need help.
Sounds like are looking for a carousel feature for you component. Winforms were not intended to be animated. Fortunately some companies have worked on products that support animaiton in this area but most are moving to the Silverlight and WPF platforms for those updated features. As a reader of MSDN Magazine I often come accross some interesting advertisements of Winform components that are quite interesting. Please take a look at this link. The cost of the product is quite high.
Telerik Sample Applications using Carousel feature in Win Forms
Also check out the following link to MSDN. It explains how you can reference the silverlight component as a COM object.
Using Silverlight in a Windows based application using COM
In this scenerio it could also be possible to embed a flash player with a flash animation, using one of the many (commercial and free) xml-based slideshows avaible for flash. This one for example http://www.flshow.net/.

Categories