|
-
Sep 22nd, 2001, 05:42 PM
#1
Thread Starter
Addicted Member
Inserting images in a richtextbox, how?
How can I insert an image in a richtextbox?
Thanx in advance.
-
Sep 22nd, 2001, 06:37 PM
#2
Frenzied Member
use the search feature on the boards, this question has been posted hundreds of times
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 22nd, 2001, 06:56 PM
#3
Try this :
VB Code:
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, lParam As Any) _
As Long
Private Const WM_PASTE = &H302
Private Sub Command1_Click()
Clipboard.SetData Picture1.Picture, vbCFBitmap
DoEvents
SendMessage RichTextBox1.hwnd, WM_PASTE, 0, 0
End Sub
-
Sep 22nd, 2001, 07:20 PM
#4
Frenzied Member
yeah, but that also clears any images the user might have on the clipboard.
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 22nd, 2001, 07:23 PM
#5
-
Sep 22nd, 2001, 07:25 PM
#6
Frenzied Member
i know... another possibility is to put the contents of the clipboard's data property into a picbox, running that code, and then copying the old data back into the clipboard.
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 22nd, 2001, 07:26 PM
#7
Thye might have a way to do it without the clipboard.
-
Sep 22nd, 2001, 07:28 PM
#8
Frenzied Member
i know there is, but obviously he couldn't think to search the boards first so u gave him a good answer that he can use
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 22nd, 2001, 08:16 PM
#9
Yes
-
Sep 22nd, 2001, 09:40 PM
#10
Fanatic Member
Without the clipboard....
VB Code:
rtb.OLEObjects.Add , , "C:\Windows\bubbles.bmp"
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Sep 22nd, 2001, 09:52 PM
#11
Yes it work well thx YoungBuck
-
Sep 22nd, 2001, 09:53 PM
#12
-
Sep 23rd, 2001, 12:16 PM
#13
Frenzied Member
because VB is a flaming homosexual, and it only likes Bitmaps, you have to first find code to conver the JPG into a BMP, and then load the BMP
Government is another way to say better…than…you.
It’s like ice but no pick, a murder charge that won’t stick,
it’s like a whole other world where you can smell the food,
but you can’t touch the silverware.
Huh, what luck. Fascism you can vote for.
Humph, isn’t that sweet?
And we’re all gonna die some day, because that’s the American way
-Stone Sour
-
Sep 23rd, 2001, 12:17 PM
#14
ahahahahaha
-
Sep 25th, 2001, 04:23 PM
#15
Thread Starter
Addicted Member
Thanx DaoK & YoungBuck appreciate the help but {rtb.OLEObjects.Add , , "C:\Windows\bubbles.bmp"} opens the default program for that image. Do you know to fix this.
Btw, I searched on the board for it I couldn't find the solution to this problem. And don't go flaming me, I'm only a kid.
-
Sep 25th, 2001, 06:14 PM
#16
rtb.OLEObjects.Add , , "C:\Windows\bubbles.bmp"
Did not open paint. but when i try something like
rtb.OLEObjects.Add , , "C:\Windows\bubbles.JPG"
I have an icon and my paint program open... maybe the file you try to open is not BMP.
-
Sep 26th, 2001, 11:07 AM
#17
Thread Starter
Addicted Member
It is a bitmap. Second, i can't load images from a resource file.
Best regards
-
Sep 26th, 2001, 11:13 AM
#18
Fanatic Member
to change from gif/jpg to bmp (hope that works)
Originally posted by Patoooey
Been a while since I've had to put an image into an RTB. Used this back them. Might be a better way now-a-days but this does work. 
VB Code:
' character pos to insert at
RichTextBox1.SelStart = 235
' load pix
Picture1.Picture = LoadPicture("d:\myimage.gif")
DoEvents
' save as BMP
SavePicture Picture1.Picture, "d:\c663dn5a.bmp"
DoEvents
' Load BMP
RichTextBox1.OLEObjects.Add , , "d:\c663dn5a.bmp"
DoEvents
-
Sep 26th, 2001, 06:58 PM
#19
Kings your code work but you can do it in reverse ( BMp to jpeg/gif).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|