473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

VB.NET Picture Box Image Pointer?

3
Hi all.

Using VB.NET

I am using a Frame grabber SDK that passes picturebox.handle to a function in the framegrabber dll and the result is that a video frame is displayed in the picture box. That bits fine.

I now need to pass a pointer to that picturebox image to another sdk dll function. I thought that passing picturebox.handle.toint32 was the same as a pointer but I get the following error.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Could someone tell me how to pass a picturebox image pointer and also maybe someone could explain what a handle is.

All help appreciated!
Jan 24 '08 #1
3 8284
Plater
7,872 Expert 4TB
You will probably have to mark that code as "unsafe" so that it does not safe guard the memory where the pointer is held.
Jan 24 '08 #2
ee0jmt
3
Hi again.

I have realised that I was trying to pass picturebox.handle.toint32 to the dll function. I changed it to:

dim p as intptr
p = picturebox.handle

and then pass p instead. I no longer get the error. However if I save the passed image using the sdk dll function and view it, it is not the image that was in the picturebox.

Is picturebox.handle a pointer to the memory that contains the image or does it need converting?

Could someone point me in the dirrection of some text that explains handles and pointers?
Jan 25 '08 #3
Plater
7,872 Expert 4TB
You could try checking in at the C/C++ or windows forum, since handles and pointers is more their realm then .NET
Jan 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: CD | last post by:
The platform is Win03, Access and SQL is available, along with all the normal image components (aspjeg, etc..). I have searched and I could spend several days looking for something. I was...
1
by: Fritz Switzer | last post by:
With two controls a PictureBox and another "PictureBox like" , Pic2, a control from a dll, I'm stuck on cannot implicity convert System.Drawing.Image to System.Drawing.Bitmap error. How do I...
0
by: wolf | last post by:
Hi I had put a PictureBox and three Buttons on a Form. I want the PictureBox show the 1.gif if I click button1 and show 2.gif if I click button2 and so on. But while it running, the value of...
2
by: Noozer | last post by:
Code sample: dim hash as Hashtable 'Declare Hashtable .... hash.add (picOne.image, "picture") 'Error here picOne is a picturebox added to the form at design time with a GIF image applied....
3
by: OptimalDesigns | last post by:
I'm trying to convert my website onto my CD drive (F:). Images are giving me problems due to lack of knowledge for sure. My image url looks like this ......
3
by: abspring | last post by:
Hi I am a technology teacher/support person at an elementary school. I have created a database in which I need to insert a picture for each of our 650+ students. I have a table of student...
1
by: WELCOME ### | last post by:
Hi every one Can I place an Image OR picture in any output program of C++ / without using "Controls"(Native C++) Thanks all ===================================
1
underscore
by: underscore | last post by:
i use a php4 and apache2.0 b4 with mysql4 or lower in my php program. when i use xampp every i can't view my stored image already in html... here's my code. <?php $db_server ="Localhost";...
1
by: MaryKJolly | last post by:
I want to display picture stored in an Access Database in a Picture/Image Box at run time. What should be the data type of the field? What should be the code?
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.