473,378 Members | 1,658 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,378 software developers and data experts.

Copy Image in picturebox to another picturebox

I'm developing a drawing software in visual basic .Net and i need to copy the
image that exists in a picturebox and automaticaly paste it in another
picturebox as being part of that other image. Its something like this: in
pictureboxA we have the image of an head and in pictureboxB we have the image
of an eye, and i need to put the eye in pictureboxA, in its correct location
without the user even notice that there is a pictureboxB.
Now, i've tried several things and the closest i've got was something like
the code that i show here, but the problem is that when the image is
transfered to the other picturebox the image goes to a location that is not
the correct one. The varibles values are correct but for some reason the
image goes to an undifined location

picMolarSuperior.Top = lngPontoApiceMolarSuperior.Y
picMolarSuperior.Left = lngPontoContactoDistalPrimeiroMolar.X
picMolarSuperior.Height = (lngPontoContactoDistalPrimeiroMolar.Y -
lngPontoApiceMolarSuperior.Y) + 9
picMolarSuperior.Width = lngPontoContactoMesialPrimeiroMolar.X -
lngPontoContactoDistalPrimeiroMolar.X

Dim rectDados As New Rectangle(lngPontoApiceMolarSuperior.X,
lngPontoApiceMolarSuperior.Y, lngPontoContactoMesialPrimeiroMolar.X -
lngPontoContactoDistalPrimeiroMolar.X, (lngPontoContactoDistalPrimeiroMolar.Y
- lngPontoApiceMolarSuperior.Y) + 9)

Dim rectRetorno As Rectangle
rectRetorno = picMolarSuperior.ClientRectangle
picMolarSuperior.DrawToBitmap(picDraw.Image, rectRetorno)

Nov 21 '05 #1
0 1616

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
1
by: Novice | last post by:
I'm afraid I will incur the wraith of Mr. Powell on this one - but I did read his #1 FAQ and some others and I still can't figure this out. I created this little c# app. and I have a PictureBox...
2
by: Mad Scientist Jr | last post by:
I have a bitmap (32 pixels high, 8192 pixels wide) that contains 255 images, each 32 pixels wide, that I would like to chop up into individual 32x32 bitmap files. Rather than spending hours in...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
4
by: John Swan | last post by:
Hello. I'm trying to create a simple program that amongst other things creates a thumbnail of an image (Bitmap) to a set size determined by the user in pixels? The problem is: All of the...
0
by: mhospodarsky | last post by:
Hi-- I am using VB.Net 2002 for this app. I am working with Tiff and jpeg images. I have a picturebox set up that I use to view the images. I have the picture box inside of a scrollable...
0
by: =?Utf-8?B?UmljYXJkbyBGdXJ0YWRv?= | last post by:
I'm having problems on drawing an image inside a picturebox. The situation is this: I have a picturebox with an image.whenever i click the mouse right button, another picturebox will appear on top...
4
by: Jerry West | last post by:
I have a routine that updates a PictureBox image every x seconds. I do this by first loading an array with the path to all of the images. I then generate a random number to use as the index of the...
2
by: mrcw | last post by:
How can i copy a picturebox.image to another picturebox on another form? thx mark
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.