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

Notification

Icon
Error

Options
Go to last post Go to first unread
keesjalink  
#1 Posted : Friday, May 5, 2006 7:40:36 PM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

Hi All,

what is the way to pre-load a bitmapviewer at program-startup with an image without loading it from file?

I use VB6. With a picturebox, you can simply at design-time load an image file, which will thereafter be included in your program. Can that be done with Aurigma?

Thanks, Kees

Andrew  
#2 Posted : Friday, May 5, 2006 10:03:39 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)
Hi Kees,

Unfortunately it cannot be done in design-time. So the only way to pre-load an image at program startup is to call LoadFromFile in Form_Load.

keesjalink  
#3 Posted : Friday, May 5, 2006 11:55:14 PM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

Thanks.

Might there be a way by using a VB6 picturebox as a picture store, and then copying the picture to a bitmapviewer in Form_load()?

For example, by setting a pointer to the picturebox.picture and use CopyMemory to transfer it to the bitmapviewer?

It is kind of important because I am distributing a lot of copies of my software to students, and I want to present them with as fool-proof as possible startup.

Thanks, Kees

Andrew  
#4 Posted : Sunday, May 7, 2006 11:26:46 AM(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)
You can do it in the following way:

Code:
BitmapViewer1.Bitmap.Data.Picture = Picture1.Picture
BitmapViewer1.Bitmap.Data.ConvertTo24bppRgb

However I did not quite understand why you need it - do you have your students to modify the source code of your application?

Edited by user Thursday, December 20, 2007 4:39:16 PM(UTC)  | Reason: Not specified

keesjalink  
#5 Posted : Monday, May 8, 2006 6:13:44 AM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

Thanks, Andrew.

No, the students do not modify the source.

I have made a program for scientific image analysis that is based on Aurigma. The idea is to collect three different microscopic images of a cluster of cells labeled with 2 different colors. I collect pictures:

1) illuminate with blue, detect 'blue' with a monochrome CCD camera with blue filter

2) illuminate green, detect 'green'

3) illuminate blue, but detect in green (i.e., this is a spectral 'bleed-through' image)

The colors show a very interesting property (called FRET) that allows us to directly calculate molecular interactions because they change the amount of bleedthrough. So my program calculates molecular interactions from a set of 3 images.

Quite different from your usual applications, not?

I'll be happy to tell you more, but perhaps of this forum because I have not seen other guys use Aurigma for scientific calculations.

best regards, Kees

keesjalink  
#6 Posted : Monday, May 8, 2006 6:18:29 AM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

Oh, and the reason why I need to include the pictures is this.

Biology students are so amazingly stupid that no matter how many errors you catch, they will crash my program.

So for the absolute morons between them for who even 'load 3 different images' is too difficult, I want to preload the images. This cannot be done with 'loadfromfile' because even those files, they manage to delete. I figured: one .exe file that contains absolutely everything they need is the only way to make it fool-proof.

Kees

keesjalink  
#7 Posted : Monday, May 8, 2006 4:23:36 PM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

Andrew,

still something seems to go wrong with the solution you suggested.

If I clone the picture that was just generated by your two lines, I get an unexpected error and am asked to contact Aurigma:

Code:
Private Sub cmdtest_Click()
    'get pic from picturebox
    bmvLut.Bitmap.Data.Picture = formPicStore.picGrayLut.Picture
    bmvLut.Bitmap.Data.ConvertTo24bppRgb
    set bmvStampLUT.Bitmap = bmvLut.Bitmap.Clone  <<-- error
End Sub

any ideas?

Kees

Edited by user Thursday, December 20, 2007 4:38:33 PM(UTC)  | Reason: Not specified

Andrew  
#8 Posted : Wednesday, May 10, 2006 4:55:27 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)
Quote:
keesjalink (5/8/2006)

This cannot be done with 'loadfromfile' because even those files, they manage to delete. I figured: one .exe file that contains absolutely everything they need is the only way to make it fool-proof.

In fact you can store images as byte arrays and load the image using LoadFromMemory method.

Quote:
If I clone the picture that was just generated by your two lines, I get an unexpected error and am asked to contact Aurigma

Do you get this exception if you clone the image loaded from file (i.e. use LoadFromFile instead of

bmvLut.Bitmap.Data.Picture = formPicStore.picGrayLut.Picture)?

keesjalink  
#9 Posted : Wednesday, May 24, 2006 4:57:33 AM(UTC)
keesjalink

Rank: Member

Groups: Member
Joined: 3/22/2004(UTC)
Posts: 18

No I only get this error if I clone it from the picturebox in the way I described.

Cloning from Loadfromfile routinely goes fine.

Best regards, Kees

(sorry for the delay in answering. I was abroad)

Andrew  
#10 Posted : Wednesday, May 24, 2006 5:45:08 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)
Ok, I have told developers to check this problem out. Meanwhile, try the following workaround: right after clone select output image format:

Code:
bmvLut.Bitmap.Formats.SelectCurrent "BMP"
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.