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

C#

 
GeneralRe: If (something) or (somethingElse) problem Pin
Adrian Stanley5-Apr-04 1:16
Adrian Stanley5-Apr-04 1:16 
GeneralRe: If (something) or (somethingElse) problem Pin
Jeremy Kimball5-Apr-04 3:42
Jeremy Kimball5-Apr-04 3:42 
Generalgenerate rtf code of pictures/images Pin
Jay Shankar4-Apr-04 18:50
Jay Shankar4-Apr-04 18:50 
GeneralRe: generate rtf code of pictures/images Pin
Heath Stewart4-Apr-04 19:33
protectorHeath Stewart4-Apr-04 19:33 
GeneralRe: generate rtf code of pictures/images Pin
Jay Shankar4-Apr-04 20:47
Jay Shankar4-Apr-04 20:47 
GeneralRe: generate rtf code of pictures/images Pin
Heath Stewart5-Apr-04 4:13
protectorHeath Stewart5-Apr-04 4:13 
GeneralRe: generate rtf code of pictures/images Pin
je_gonzalez5-Apr-04 12:44
je_gonzalez5-Apr-04 12:44 
GeneralRe: generate rtf code of pictures/images Pin
Jay Shankar5-Apr-04 15:15
Jay Shankar5-Apr-04 15:15 
Dear Heath Stewart and Gonzalez,
thanks a lot for the solution and guidance, it solves the purpose. I am pasting my complete Demo code.This can be helpful to another developers

//For running the sample code paste the following in button click event
private void button1_Click(object sender, System.EventArgs e)
{
	string strImageToRTF ="";// string to hold rtf code

	//create the file where rtf code has to be written
	string strfileName = "ImageInRTFfile.rtf";
	FileStream MyStream = new FileStream("c:\\" + strfileName, FileMode.Create);
	System.IO.StreamWriter MyWriter =new System.IO.StreamWriter(MyStream,System.Text.Encoding.Default);
	//

	//Prepare image object from image file 
	Image img = new Bitmap(@"c:\myimage.bmp");
        //

	//get the RTF string from the method  ImageToRTF   
	strImageToRTF = this.ImageToRTF(img);
        //

	//write the generated RTF string into the file
	MyWriter.Write(strImageToRTF);
        //

	//close Stream Writer and File Stream
	MyWriter.Close();
	MyStream.Close();
	//
}
//

//
// Method to get the rtf code string from the image object
private  string ImageToRTF(Image img)
{
	RichTextBox rtf = new RichTextBox();
	Clipboard.SetDataObject(img);
	rtf.Paste();
	return rtf.Rtf;
}
//
//


Thanks and Regards,

Jay.
GeneralComponent Properties Pin
dbetting4-Apr-04 17:57
dbetting4-Apr-04 17:57 
GeneralRe: Component Properties Pin
Heath Stewart4-Apr-04 18:10
protectorHeath Stewart4-Apr-04 18:10 
GeneralRe: Component Properties Pin
dbetting5-Apr-04 10:06
dbetting5-Apr-04 10:06 
GeneralRe: Component Properties Pin
Heath Stewart5-Apr-04 10:34
protectorHeath Stewart5-Apr-04 10:34 
QuestionGenerating listbox based on dataset? Pin
MeterMan4-Apr-04 17:45
MeterMan4-Apr-04 17:45 
AnswerRe: Generating listbox based on dataset? Pin
Heath Stewart4-Apr-04 18:06
protectorHeath Stewart4-Apr-04 18:06 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan4-Apr-04 19:09
MeterMan4-Apr-04 19:09 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 10:41
MeterMan5-Apr-04 10:41 
GeneralRe: Generating listbox based on dataset? Pin
Heath Stewart5-Apr-04 10:46
protectorHeath Stewart5-Apr-04 10:46 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 11:03
MeterMan5-Apr-04 11:03 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 14:37
MeterMan5-Apr-04 14:37 
GeneralRe: Generating listbox based on dataset? Pin
Heath Stewart5-Apr-04 17:20
protectorHeath Stewart5-Apr-04 17:20 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 18:27
MeterMan5-Apr-04 18:27 
GeneralRe: Generating listbox based on dataset? Pin
Heath Stewart5-Apr-04 18:34
protectorHeath Stewart5-Apr-04 18:34 
GeneralRe: Generating listbox based on dataset? Pin
MeterMan5-Apr-04 21:14
MeterMan5-Apr-04 21:14 
GeneralChanging menu bars color Pin
MeterMan4-Apr-04 16:34
MeterMan4-Apr-04 16:34 
GeneralRe: Changing menu bars color Pin
Heath Stewart4-Apr-04 18:00
protectorHeath Stewart4-Apr-04 18:00 

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.