eddie_kho
asked on
how to display icon/picture in memo?
i want to display an icon in a memo... you can see something like this in Yahoo!Messenger
using a memo is just my idea, if anybody can do the same thing (like in Yahoo!Messenger) using any other object... please submit your advice, thnks....
using a memo is just my idea, if anybody can do the same thing (like in Yahoo!Messenger) using any other object... please submit your advice, thnks....
use TRichEdit
ASKER
slavak:
i've tried and read the help files, but still not found any related topics to solve this problem...
would u please more specific about using TRichEdit?
i've tried and read the help files, but still not found any related topics to solve this problem...
would u please more specific about using TRichEdit?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use a TBitmap, load/draw the bitmap, copy to the
clipboard, then use RichEdit1.PasteFromClipboa rd.
It goes a little somethin like this:
var
b:TBitmap;
begin
b := TBitmap.Create;
b.LoadFromFile('c:\msngrpi c.bmp');
Clipboard.Assign(b);
RichEdit1.PasteFromClipboa rd;
b.Free;
end;
clipboard, then use RichEdit1.PasteFromClipboa
It goes a little somethin like this:
var
b:TBitmap;
begin
b := TBitmap.Create;
b.LoadFromFile('c:\msngrpi
Clipboard.Assign(b);
RichEdit1.PasteFromClipboa
b.Free;
end;
ASKER
rondi:
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap (1,picTemp );
image1.Canvas.Draw(0,0,pic Temp);
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa rd;
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap
image1.Canvas.Draw(0,0,pic
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
ASKER
rondi:
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap (1,picTemp );
image1.Canvas.Draw(0,0,pic Temp);
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa rd;
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap
image1.Canvas.Draw(0,0,pic
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
ASKER
rondi:
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap (1,picTemp );
image1.Canvas.Draw(0,0,pic Temp);
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa rd;
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap
image1.Canvas.Draw(0,0,pic
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
ASKER
rondi:
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap (1,picTemp );
image1.Canvas.Draw(0,0,pic Temp);
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa rd;
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
it doesn't work
......
......
picTemp := TBitmap.Create;
form1.imagelist1.GetBitmap
image1.Canvas.Draw(0,0,pic
Clipboard.Assign(picTemp);
richedit1.PasteFromClipboa
......
......
the image1 display the icon i meant to be, but the icon doesn't displayed on the richedit1
Could I ask both eddie and the others?
What versions of delphi are you using?
Delphi3
What versions of delphi are you using?
Delphi3
ASKER
i'm using d5
eddie_kho,
I have asked about this image and memo a while back. Things haven't changed. It is still a 'can't do'
with a Memo.
Here is a copy of what I got from before:
********** copied
From: edey
Date: 09/09/2000 02:44PM PST
There are some enhanced
TRichEdits that can handle this though, you can find one here:
http://www.trichview.com/
other alternatives are trying html instead (though most html controls don't let you edit the text well)
and ole controls that might, say, let you insert a word doc.
GL
Mike
Comment
From: edey
Date: 09/07/2000 06:20PM PST
you _could_ save the _visible_ text as an image, but I'm not shure that's what he wants
GL
Mike
Accepted Answer
From: edey
Date: 09/07/2000 01:30PM PST
the problem is that the memo doesn't actually contain the bmp - you've merely painted it on. To save
as part of the memo's content you'd have to change controls to something that supports it. You could
try something like an html renderer, or an enhanced richedit, but TMemo does not natively support this.
The closest I can imagine is to hack out you own parser for load/save to file that would check for
images in the data file, and before you know it you've written an entire word proccessor :(
Gl
mike
Comment
From: VVT
Date: 09/08/2000 08:01AM PST
You can think about a solution using a special TRichEdit control instead
Comment
From: delphi3
Date: 09/07/2000 11:15PM PST
Mike and others,
I was looking to put them into one save but apparently that is not possible from what I read above.
I am still thinking that I may/must have 3 saves
1. the image.
2. the text.
3 the position of the image on the memo.
but for the moment it is very late for this attempt so I will try in about 4-6 hours.
On the otherhand, Mike, what are you suggesting?
Do you have something in mind? I have a model that one writes on the image and it is all together as
one there and saved. But there again that is not an image on a memo and with text not on the image.
Delphi3.
Comment
From: delphi3
Date: 09/08/2000 09:39PM PST
Hi
Thanks to you all for helping out.
I gave the points to Mike as he made the first observations that this is impossible. I cannot see why
someone would ever want to paint the bmp on a memo other than the curiosity of doing it.
I have tried the saving the text, and the image and the position of the image,and in that sense I can
put it all back but the moment I try add more text ever thing fails.
So thanks to all again,
Delphi3
********** End of copied
I have D4 standard edition. And even with RichEdit I can't get an image to stick.
I have Win2k. I have decided to look at what does work (an image and text) on my computer
and tried to work that. Recently I have downloaded this and it allows me to work with Word.
http://support.microsoft.com/support/kb/articles/Q229/3/10.ASP
And today I worked with a 'safe call' to call 'WordPad'.
procedure TForm1.Button1Click(Sender : TObject);
var
Str1, Str2, Totalcmdline: string;
begin
Str1 := 'C:\...\Windows NT\Accessories\WordPad.exe ';
Str2 := ExtractFilePath(Applicatio n.exeName) + 'FormS.rtf';
Totalcmdline := str1 + ' "' + str2 + ' "';
Cprocess(Totalcmdline, Self);
end;
procedure TForm1.Cprocess(sExecuteFi le: string; Sender: TObject);
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof(si), 0);
si.cb := sizeof(si);
CreateProcess(nil, PChar(sExecuteFile), nil, nil, false, NORMAL_PRIORITY_CLASS, nil, nil, si, pi);
// close up shop...
closeHandle(pi.hProcess);
closeHandle(pi.hThread);
end;
If you want more details please comment me back.
Delphi3
I have asked about this image and memo a while back. Things haven't changed. It is still a 'can't do'
with a Memo.
Here is a copy of what I got from before:
********** copied
From: edey
Date: 09/09/2000 02:44PM PST
There are some enhanced
TRichEdits that can handle this though, you can find one here:
http://www.trichview.com/
other alternatives are trying html instead (though most html controls don't let you edit the text well)
and ole controls that might, say, let you insert a word doc.
GL
Mike
Comment
From: edey
Date: 09/07/2000 06:20PM PST
you _could_ save the _visible_ text as an image, but I'm not shure that's what he wants
GL
Mike
Accepted Answer
From: edey
Date: 09/07/2000 01:30PM PST
the problem is that the memo doesn't actually contain the bmp - you've merely painted it on. To save
as part of the memo's content you'd have to change controls to something that supports it. You could
try something like an html renderer, or an enhanced richedit, but TMemo does not natively support this.
The closest I can imagine is to hack out you own parser for load/save to file that would check for
images in the data file, and before you know it you've written an entire word proccessor :(
Gl
mike
Comment
From: VVT
Date: 09/08/2000 08:01AM PST
You can think about a solution using a special TRichEdit control instead
Comment
From: delphi3
Date: 09/07/2000 11:15PM PST
Mike and others,
I was looking to put them into one save but apparently that is not possible from what I read above.
I am still thinking that I may/must have 3 saves
1. the image.
2. the text.
3 the position of the image on the memo.
but for the moment it is very late for this attempt so I will try in about 4-6 hours.
On the otherhand, Mike, what are you suggesting?
Do you have something in mind? I have a model that one writes on the image and it is all together as
one there and saved. But there again that is not an image on a memo and with text not on the image.
Delphi3.
Comment
From: delphi3
Date: 09/08/2000 09:39PM PST
Hi
Thanks to you all for helping out.
I gave the points to Mike as he made the first observations that this is impossible. I cannot see why
someone would ever want to paint the bmp on a memo other than the curiosity of doing it.
I have tried the saving the text, and the image and the position of the image,and in that sense I can
put it all back but the moment I try add more text ever thing fails.
So thanks to all again,
Delphi3
********** End of copied
I have D4 standard edition. And even with RichEdit I can't get an image to stick.
I have Win2k. I have decided to look at what does work (an image and text) on my computer
and tried to work that. Recently I have downloaded this and it allows me to work with Word.
http://support.microsoft.com/support/kb/articles/Q229/3/10.ASP
And today I worked with a 'safe call' to call 'WordPad'.
procedure TForm1.Button1Click(Sender
var
Str1, Str2, Totalcmdline: string;
begin
Str1 := 'C:\...\Windows NT\Accessories\WordPad.exe
Str2 := ExtractFilePath(Applicatio
Totalcmdline := str1 + ' "' + str2 + ' "';
Cprocess(Totalcmdline, Self);
end;
procedure TForm1.Cprocess(sExecuteFi
var
pi: TProcessInformation;
si: TStartupInfo;
begin
FillMemory(@si, sizeof(si), 0);
si.cb := sizeof(si);
CreateProcess(nil, PChar(sExecuteFile), nil, nil, false, NORMAL_PRIORITY_CLASS, nil, nil, si, pi);
// close up shop...
closeHandle(pi.hProcess);
closeHandle(pi.hThread);
end;
If you want more details please comment me back.
Delphi3
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
accept bugroger's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thanks,
geobul
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
accept bugroger's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thanks,
geobul
EE Cleanup Volunteer