-
Jan 29th, 2014, 10:37 AM
#1
Thread Starter
Fanatic Member
Weird issue with PictureBox control
Everytime I reference the picturebox control the image/picture disappears. For example:
Private Sub Command1_Click()
PicturePrint.Picture = Picture2.Picture
End Sub
Neither PictureBox has an image.
Picture2.Picture is initially set by a third party control (Secugen SDK). AutoRedraw is set to true.
Any ideas? Also, when something on the screen covers an area of Picture2 that area is no longer visible.
-
Jan 29th, 2014, 11:25 AM
#2
Re: Weird issue with PictureBox control
Are you sure that Picture2.Picture is set?
Perhaps Secugen SDK writes to the .Image so what you want is.
PicturePrint.Picture = Picture2.Image
-
Jan 29th, 2014, 12:04 PM
#3
Thread Starter
Fanatic Member
Re: Weird issue with PictureBox control
How can I be sure whether .Image and/or .Picture has data?
-
Jan 29th, 2014, 01:02 PM
#4
Thread Starter
Fanatic Member
Re: Weird issue with PictureBox control
During debugging I stop on the line and check the Picture2.Image.Height and Picture2.Image.Width properties and there was data there. The numbers are not the dimensions of the control?
-
Jan 29th, 2014, 01:18 PM
#5
Re: Weird issue with PictureBox control
Have you tried
Set PicturePrint.Picture = Picture2.Picture
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jan 29th, 2014, 02:07 PM
#6
Thread Starter
Fanatic Member
Re: Weird issue with PictureBox control
Originally Posted by jmsrickland
Have you tried
Set PicturePrint.Picture = Picture2.Picture
Yes. As soon as it hits that line of code the image disappears.
-
Jan 29th, 2014, 05:03 PM
#7
Re: Weird issue with PictureBox control
You might not realize that jmsrickland didn't say:
PicturePrint.Picture = Picture2.Picture
he said
Set PicturePrint.Picture = Picture2.Picture
The "Set" is assigning an object to another object, which is different than what you showed in post #1.
The .Image context will exist, because you set AutoRedraw to True.
I would assume that the scanner would write the scanned image to the picturebox, and if you can see it, it means it is in the .Image context of the picturebox because you have AutoRedraw set True. You can't bitblt or draw into the .Picture context of a picturebox normally, you have to assign an image to it.
If you look at the value of Picture2.Image.Width, you should see a large value, as the value is in HiMetric units.
You can covert from HiMetric to another unit, pixels for instance, like this
WidthInPixels = ScaleX(Picture2.Image.Width,vbHiMetric,vbPixels)
If you look at the value of Picture2.Picture.Width, you will probably see 0, as there is likely to be no image loaded into the .Picture context of the picturebox.
That is why I suggested trying to assign the .Image to the other picturebox instead of the .Picture.
On the otherhand, since these are objects, I don't know if I would try to assign one to the other, otherwise they could both be pointing to the same object, which you might not want.
You could always use
PicturePrint.PaintPicture Picture2.Image, 0,0
to see if you can paint the image from Picture2 to the other picturebox, so it would definitely be no connection between the two images.
Last edited by passel; Jan 29th, 2014 at 05:07 PM.
-
Jan 29th, 2014, 08:28 PM
#8
Thread Starter
Fanatic Member
Re: Weird issue with PictureBox control
I have tried the various ways described. I talked to the Secugen people and they informed me that their control is only creating the raw image file. This may be why the image disappears. I now need to find out how to deal with the raw image data. This data is in a byte[] called buffer. Does anybody have any ideas or samples for dealing with raw image data?
-
Jan 30th, 2014, 05:36 AM
#9
Re: Weird issue with PictureBox control
What are you using the thirdparty control for?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 30th, 2014, 08:17 AM
#10
Thread Starter
Fanatic Member
Re: Weird issue with PictureBox control
To capture a fingerprint.
I think i just need to prepend the data with bitmap information. Struggling to find a good example.....
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
|