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

Notification

Icon
Error

Options
Go to last post Go to first unread
rkoc  
#1 Posted : Thursday, July 20, 2006 5:32:08 PM(UTC)
rkoc

Rank: Member

Groups: Member
Joined: 7/20/2006(UTC)
Posts: 4

If i'm getting a picture from the clipboard i have a stdPicture object:

Code:
  Dim objStdPicture As StdPicture
  Set objStdPicture = Clipboard.GetData(vbCFBitmap)


I want to load the picture in GraphicsMill.
I have the following code
Code:
  Dim objBitmap As GraphicsMill.Bitmap
  Set objBitmap = CreateObject("GraphicsMill.Bitmap")

  objBitmap.Data.Picture = objStdPicture

  'select the format because no format is selected
  objBitmap.Formats.SelectCurrent ("BMP")


If i look at the image ( using objBitmap.SaveToFile "c:\test.bmp" ) the image has the correct size but is white.

How to capture a image in VB and how to set the objBitmap.Data.Picture?

Or is this a problem in the trial version (besides white it also contains the added text from the trial)?


Edited by user Wednesday, December 19, 2007 3:53:02 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Sunday, July 23, 2006 1:15:41 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Most likely the problem is that you get 32-bit image that is considered by Graphics Mill as transparent. The workaround for it is to strip the bitmap of the alpha channel. The simplest way to do it is to convert it to 24-bit.

Code:
Dim objStdPicture As StdPicture
Set objStdPicture = Clipboard.GetData(vbCFBitmap)

Dim objBitmap As GraphicsMill.Bitmap
Set objBitmap = CreateObject("GraphicsMill.Bitmap")

objBitmap.Data.Picture = objStdPicture

objBitmap.Data.ConvertTo24bppRgb False

'select the format because no format is selected
objBitmap.Formats.SelectCurrent ("BMP") 


It should help.

Edited by user Wednesday, December 19, 2007 3:53:31 PM(UTC)  | Reason: Not specified

rkoc  
#3 Posted : Sunday, July 23, 2006 7:15:51 PM(UTC)
rkoc

Rank: Member

Groups: Member
Joined: 7/20/2006(UTC)
Posts: 4


Thanks.
The workaround works.
Bug in Griphics Mill?
The origional image put on the clipboard did not have a alpha channel.

Rob

rkoc  
#4 Posted : Sunday, July 23, 2006 11:56:22 PM(UTC)
rkoc

Rank: Member

Groups: Member
Joined: 7/20/2006(UTC)
Posts: 4


The 32bpp (with alpha) to 24bpp did work for the bitmap on the clipboard.
But it does not work al the time.
If i have a picture in Excel and copy it to the clipboard it is set on the clipboard as meta graphics.
Setting the picture from the clipboard direct to Griphics Mill fails. I can understand this because it is no bitmap image but a meta graphics (containing a bitmap).
If i convert it to a bitmap by painting it on a picturebox and then getting the image from it, i have a stdPicture object with a bitmap.
Setting this object on Graphics Mill works but i get a image with the correct size and totally black (not white as with the case before).
The format is again a 32bpp with alpha. But this time the conversion to 24bpp does not solve the problem. The picture stays black.
If i save the stbPicture to disk with the standard VB savepicture and read it in Graphics Mill with the loadfromfile then it does work. The SavePicture function saves a picture with 24bpp and not 32.
This works but is not preferred way because it is using a file.

Is there a solution for this?


Dmitry  
#5 Posted : Monday, July 24, 2006 8:11:24 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Rob,

Could you submit case with the image which you save to file and then load into Graphics Mill?

Edited by user Thursday, May 22, 2008 10:36:28 PM(UTC)  | Reason: Not specified

Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
rkoc  
#6 Posted : Tuesday, July 25, 2006 6:17:05 PM(UTC)
rkoc

Rank: Member

Groups: Member
Joined: 7/20/2006(UTC)
Posts: 4


Sample image and code has been send.

Rob
Dmitry  
#7 Posted : Tuesday, July 25, 2006 7:50:13 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Thanks Rob, we have received your email. we will reply to you as soon as possible.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
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.