Click here to Skip to main content
15,907,396 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Routed Command passing data Pin
Jammer2-Jun-08 8:15
Jammer2-Jun-08 8:15 
QuestionHow to set the font a bit "bold" in WPF? Pin
robin.zeng30-May-08 3:41
robin.zeng30-May-08 3:41 
AnswerRe: How to set the font a bit "bold" in WPF? Pin
Jammer30-May-08 5:32
Jammer30-May-08 5:32 
QuestionCanvas with custom coordinate system? Pin
N3croman29-May-08 10:27
N3croman29-May-08 10:27 
AnswerRe: Canvas with custom coordinate system? Pin
Leblanc Meneses29-May-08 21:39
Leblanc Meneses29-May-08 21:39 
QuestionSaving a rotation Pin
Rohde29-May-08 6:17
Rohde29-May-08 6:17 
AnswerRe: Saving a rotation Pin
Rohde29-May-08 7:48
Rohde29-May-08 7:48 
QuestionDetermine image format Pin
Rohde29-May-08 0:22
Rohde29-May-08 0:22 
Hey. I need some help determining the image format of an, well, image.

I have a small WPF program where I can open and display images. I load a BitmapImage objec,t and display it on an Image control in a window, and that all works fine.

Now I would like to save the image when changes are done to it, and I would like to save it in the format which was originally opened. So if I opened a JPEG image I would like to encode the BitmapImageSource as an JPEG using the JpegBitmapEncoder and that's all nice and works.

But when I load the BitmapImage it automatically determines the decoder to use, and when it's time to save the image I can't find an easy way of determining which encoder to use. I guess I could save the file name when I open it, and the from that deduce the file type and from that the image type and from that the encoder to use. It just seems so messy. I kind hoped the BitmapSource would save this information in some metadata, but doesn't (or so it seems).

Any advice as how to easy determine what encoder to use? Did I miss some obvious approach?



"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."

-Atlas Shrugged, Ayn Rand

AnswerRe: Determine image format Pin
ChandraRam29-May-08 1:31
ChandraRam29-May-08 1:31 
GeneralRe: Determine image format Pin
Rohde29-May-08 2:11
Rohde29-May-08 2:11 
GeneralRe: Determine image format Pin
ChandraRam29-May-08 2:23
ChandraRam29-May-08 2:23 
GeneralRe: Determine image format Pin
Rohde29-May-08 2:28
Rohde29-May-08 2:28 
AnswerRe: Determine image format Pin
Insincere Dave29-May-08 6:39
Insincere Dave29-May-08 6:39 
GeneralRe: Determine image format [modified] Pin
Rohde29-May-08 7:38
Rohde29-May-08 7:38 
Question3 ways to create a spring animation .. need help with 2 of them .. partially implemented. Pin
Leblanc Meneses28-May-08 20:57
Leblanc Meneses28-May-08 20:57 
AnswerRe: 3 ways to create a spring animation .. need help with 2 of them .. partially implemented. Pin
Leblanc Meneses29-May-08 21:35
Leblanc Meneses29-May-08 21:35 
Questionhow to create own set of tool palette? Pin
katelva28-May-08 18:58
katelva28-May-08 18:58 
AnswerRe: how to create own set of tool palette? Pin
Michael Sync28-May-08 20:10
Michael Sync28-May-08 20:10 
GeneralRe: how to create own set of tool palette? Pin
katelva3-Jun-08 19:51
katelva3-Jun-08 19:51 
GeneralRe: how to create own set of tool palette? Pin
Michael Sync4-Jun-08 20:58
Michael Sync4-Jun-08 20:58 
QuestionWalking the Visual Tree ... Pin
Jammer28-May-08 4:07
Jammer28-May-08 4:07 
QuestionRe: Walking the Visual Tree ... Pin
Jammer29-May-08 3:13
Jammer29-May-08 3:13 
AnswerRe: Walking the Visual Tree ... Pin
Insincere Dave29-May-08 6:03
Insincere Dave29-May-08 6:03 
GeneralRe: Walking the Visual Tree ... Pin
Jammer29-May-08 6:31
Jammer29-May-08 6:31 
GeneralRe: Walking the Visual Tree ... Pin
Insincere Dave29-May-08 6:53
Insincere Dave29-May-08 6:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.