473,802 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET Picture Box Image Pointer?

3 New Member
Hi all.

Using VB.NET

I am using a Frame grabber SDK that passes picturebox.hand le 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.hand le.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 8316
Plater
7,872 Recognized Expert Expert
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 New Member
Hi again.

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

dim p as intptr
p = picturebox.hand le

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.hand le 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 Recognized Expert Expert
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
1250
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 hoping to get some recommendations based on experience. I would like to stay under 100 if I was to purchase something. Goals: Autothumbnail for the viewer.
1
50620
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 convert the following code so that the Pic2 can accept the Image from the stream where it wants Picture property not and Image property. Here is a snippet, I'm trying to avoid writing to disk.: Image i = Pic1.Image;
0
1016
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 PictureBox.Image can be set one time, an exception thrown when I click the button2 after I clicked the button1 or button3 and the picture had shown. Why this error occured and what should I do? Thanks!
2
1717
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. When the add method executes I get the following error:
3
7255
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 ... file:///f:/ws_ftp/ode-cd/scripts/imagewrap.img? picture.image.url=file:///f:/ws_ftp/ode-cd/image/corp- entire_refinery.gif&picture.width.max=50&picture.height.max=0 and it doesn't work; ie. no picture shown on webpage in netscape 8.1. Is the part 'picture.image.url=file:///f:/ws_ftp/' ......
3
4691
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 information with the student id as the primary key. Another table is the student photos table that has the student id and the imagename.bmp of the photo of that student and a OLE Object field for the picture image. All of the actual picture files are .bmp...
1
1535
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
1975
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"; $db_name ="pass"; $db_username = "root";
1
1498
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
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10536
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10285
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.