Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
charlievandien  
#1 Posted : Sunday, June 05, 2005 6:24:00 AM(UTC)
charlievandien

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
Fedor  
#2 Posted : Sunday, June 05, 2005 6:39:00 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,511

Thanks: 3 times
Was thanked: 49 time(s) in 48 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
charlievandien  
#3 Posted : Sunday, June 05, 2005 8:13:00 AM(UTC)
charlievandien

Rank: Member

Groups: Member
Joined: 6/5/2005(UTC)
Posts: 4

Thanks Fedor!
-c
charlievandien  
#4 Posted : Sunday, June 05, 2005 8:22:00 AM(UTC)
charlievandien

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

Fedor  
#5 Posted : Sunday, June 05, 2005 2:31:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,511

Thanks: 3 times
Was thanked: 49 time(s) in 48 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
Users browsing this topic
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.