Why would you be drawing PictureBox2
to an Image
and then displaying that Image
in the same PictureBox2
? Surely you should be drawing from one place and displaying somewhere else.
Also, never just say that something doesn't work. That could mean anything. Explain EXACTLY what happens and EXACTLY how that differs from your expectations.
hi. sorry. its VideoSourcePlayer1.DrawToBitmap(img, New Rectangle(0, 0, RectangleShape1.Width, RectangleShape1.Height)).
ok, first, i have to know how do i capture image within the RectangleShape1, and thanks to mr JohN for the idea he gave.
in my understanding. this code: "Annex A" will only get the Width and Height of the RectangleShape1, and not include the location of the RectangleShape1. (i knew it because when i try to use this code: img.save("c:\sample.png") : to just view the result, the captured/saved image was top right corner of the VideoSourcePlayer1). and i think maybe its because of (0,0, ,) in (img, New Rectangle(0, 0, RectangleShape1.Width, RectangleShape1.Height)). idk, so i tried replacing it with different value and tried using the : RectangleShape1.left, RectangleShape1.top : code but i cant get it right. sometimes the result was black or off the source. what should i do?
Annex A ------
Dim img As Bitmap = New Bitmap(RectangleShape1.Width, RectangleShape1.Height)
VideoSourcePlayer1.DrawToBitmap(img, New Rectangle(0, 0, RectangleShape1.Width, RectangleShape1.Height))
-----
second is, how do i post or display the the captured image in PictureBox2? should i use the save and load method? like save the image first, then load it in the PictureBox2? but i'd like to avoid it if possible, because i want to add file name of my choice after the captured image is displayed in PictureBox2.
ive tried : PictureBox2.Image = img : but got no result.