Rank: Member
Groups: Member
Joined: 6/5/2005(UTC) Posts: 4
|
I'm using GraphicsMill and I need a way to get a bitmap from the Clipboard into the Viewer.
Does anyone have an example?
Thanks! -charlie
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,659
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
Hello Charlie, Here is the code: Code:Private Sub Command1_Click()
Dim objBitmap As New Bitmap
objBitmap.Data.Picture = Clipboard.GetData()
objBitmap.Data.ConvertTo24bppRgb False
'objBitmap.SaveToFile "c:\clipboard.jpg"
BitmapViewer1.Btimap = objBitmap
End Sub
Don't forget to add checking of current clipboard data format. Edited by user Sunday, December 23, 2007 6:16:28 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Rank: Member
Groups: Member
Joined: 6/5/2005(UTC) Posts: 4
|
|
|
|
|
Rank: Member
Groups: Member
Joined: 6/5/2005(UTC) Posts: 4
|
Fedor, Got a problem, probably something dumb that I'm missing... I took care of the typo, but when I run this I get "Object doesn't support this property or method" on this line: Code:BitmapViewer1.Bitmap = objBitmap
Any ideas? Thnaks, -charlie Edited by user Sunday, December 23, 2007 6:16:43 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,659
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
I am sorry, I have forgotten to add Set keyword, which is required in VB6. Here is correct code: Code:Private Sub Command1_Click()
Dim objBitmap As New Bitmap
objBitmap.Data.Picture = Clipboard.GetData()
objBitmap.Data.ConvertTo24bppRgb False
'objBitmap.SaveToFile "c:\clipboard.jpg"
Set BitmapViewer1.Bitmap = objBitmap
End Sub
Edited by user Sunday, December 23, 2007 6:16:54 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.