Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
AnswerRe: form apearance PinPopular
Dan Mos28-Aug-10 8:29
Dan Mos28-Aug-10 8:29 
AnswerRe: form apearance Pin
PIEBALDconsult29-Aug-10 5:45
mvePIEBALDconsult29-Aug-10 5:45 
AnswerRe: form apearance Pin
Abhinav S29-Aug-10 6:37
Abhinav S29-Aug-10 6:37 
AnswerRe: form apearance Pin
Pete O'Hanlon29-Aug-10 9:43
mvePete O'Hanlon29-Aug-10 9:43 
GeneralRe: form apearance Pin
ronakT4-Sep-10 9:38
ronakT4-Sep-10 9:38 
QuestionLoad print templates Pin
dSolariuM28-Aug-10 1:42
dSolariuM28-Aug-10 1:42 
QuestionRe: Load print templates Pin
Yusuf28-Aug-10 4:55
Yusuf28-Aug-10 4:55 
AnswerRe: Load print templates Pin
Abhinav S28-Aug-10 5:22
Abhinav S28-Aug-10 5:22 
QuestionVisual Studio 2010 crashes when designer finishes loading Pin
WebMaster28-Aug-10 1:03
WebMaster28-Aug-10 1:03 
AnswerRe: Visual Studio 2010 crashes when designer finishes loading Pin
Philippe Mori28-Aug-10 2:39
Philippe Mori28-Aug-10 2:39 
GeneralRe: Visual Studio 2010 crashes when designer finishes loading Pin
WebMaster28-Aug-10 4:03
WebMaster28-Aug-10 4:03 
GeneralRe: Visual Studio 2010 crashes when designer finishes loading Pin
WebMaster28-Aug-10 4:40
WebMaster28-Aug-10 4:40 
Questionrun a method on other application Pin
solomon8528-Aug-10 0:47
solomon8528-Aug-10 0:47 
AnswerRe: run a method on other application Pin
Eddy Vluggen28-Aug-10 3:16
professionalEddy Vluggen28-Aug-10 3:16 
AnswerRe: run a method on other application Pin
dan!sh 28-Aug-10 3:37
professional dan!sh 28-Aug-10 3:37 
AnswerRe: run a method on other application Pin
Abhinav S28-Aug-10 5:26
Abhinav S28-Aug-10 5:26 
QuestionBacking up database file using SMO error Pin
gamer112727-Aug-10 16:52
gamer112727-Aug-10 16:52 
Questionbuilding a win form application problem Pin
mrkeivan27-Aug-10 11:37
mrkeivan27-Aug-10 11:37 
AnswerRe: building a win form application problem Pin
Not Active27-Aug-10 12:01
mentorNot Active27-Aug-10 12:01 
QuestionWin7 No PingCompletedCallback on timeout? Pin
Gavin Coates27-Aug-10 7:44
Gavin Coates27-Aug-10 7:44 
QuestionCustom file type Pin
Etienne_12327-Aug-10 5:29
Etienne_12327-Aug-10 5:29 
AnswerRe: Custom file type Pin
OriginalGriff27-Aug-10 5:46
mveOriginalGriff27-Aug-10 5:46 
GeneralRe: Custom file type Pin
Etienne_12327-Aug-10 6:14
Etienne_12327-Aug-10 6:14 
AnswerRe: Custom file type Pin
Chris Trelawny-Ross27-Aug-10 5:47
Chris Trelawny-Ross27-Aug-10 5:47 
A simple trick might be to write some binary value - an indicator byte/int/long plus some indicator of the type of image that the rest of the file contains (e.g. 0xD1CEDBEE + ".JPG" for a total of 8 bytes, or 12 if you save the string as multibyte characters) - at the beginning of a new file, then stream the binary of the high-res image immediately following that byte. Save the file with a custom extension 'xxx.hires' or somesuch.

The presence of the custom header will prevent any standard software from being able to process the file as a recognized image file.

The custom app can validate the header, then create a .Net Image object from the remainder of the content in the file.

Specifying the embedded image type in the header allows for future implementations that use other file formats (which may not necessarily be images at all). If you don't like having ".JPG" in readable characters, XOR each byte of the string with some binary value, say 0x53. Just XOR them again when reading them back, to get back to the original characters.

You should probably also include a length field describing the embedded string, for flexibility, instead of assuming that it is always going to be 4 characters; I would also include a version # "just in case".
AnswerRe: Custom file type Pin
OriginalGriff27-Aug-10 5:51
mveOriginalGriff27-Aug-10 5:51 

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.