3
Answers

Inserting datetime in a rich text box

Bob Congdon

Bob Congdon

15y
7.4k
1
Greetings. I'm very much a newbie at C#. I've taken a couple of online classes, but I still have very much to learn. I'm developing a small word processor application (just to see if i can do it, and for my own use when it's finished) and I need to know how to insert the DateTime object into a rich text box wherever the cursor happens to be at the time, just like it works in Wordpad. This kind of code is beyond my current understanding. I have most of the functionality of what a typical user would expect from a word processor working reasonably well, but I would love to have this function as part of my program. Thanks for whatever help you can provide and for your time.

Bob C.
Answers (3)
0
Santiago Felipe
NA 2 0 9y
Do you mean you want to convert the JPEG image to PNG while loading the JPEG image (and not after)?

Are you selecting and loading the JPEG image using the OpenFileDialog Class?

If yes, you can get the name of the JPEG file, pass it Image.FromFile method:
https://msdn.microsoft.com/en-us/library/system.drawing.image.fromfile.aspx
And then save it to PNG using the
Image.Save method (Stream, ImageFormat):
https://msdn.microsoft.com/en-us/library/ms142147.aspx

But if you face any problem while loading or saving the JPEG or PNG images, you can try using loading and saving features from leadtools programming toolkit.
0
Raja T
NA 7.4k 6k 9y
Hi,

Please refer below URLs

http://stackoverflow.com/questions/17294737/converting-an-image-to-png-on-upload


http://stackoverflow.com/questions/3906260/how-can-i-convert-a-jpeg-image-to-a-png-one-with-transparent-background


http://www.c-sharpcorner.com/UploadFile/scottlysle/ImageConverter09132006105604AM/ImageConverter.aspx

Thanks