|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Moving Rectangle within a PictureBox ControlI am a real novice when it comes to the graphics class in VB 2005. I have a
windows app with a large picture box control with a black background ... except for a small rectangle that has an image in it. A timer fires every second or so and when it does I want to move the small rectangle within the picture box to another location within the picture box. I don't want to copy the rectangle ... I want to move it and have the vacated rectangle revert to the black background. Now, this program is an upgraded version of a VB .Net 2003 version I had written. In that version I used the bitblt function to move this box but, as is so often the case, that function is not supported in VB 2005. Can someone help me understand how to move a junk of the screen from one location to another? I would appreciate whatever specificity you can provide ... I really am a novice! Thanks. "fripper" <yo***@indiana.edu> schrieb What does "not supported" mean?> I am a real novice when it comes to the graphics class in VB 2005. I have > a windows app with a large picture box control with a black > background ... except for a small rectangle that has an image in it. > A timer fires every second or so and when it does I want to move > the small rectangle within the picture box to another location > within the picture box. I don't want to copy the rectangle ... I > want to move it and have the vacated rectangle revert to the black > background. Now, this program is an upgraded version of a VB .Net > 2003 version I had written. In that version I used the bitblt > function to move this box but, as is so often the case, that > function is not supported in VB 2005. > Can someone help me The usual way is to repaint everything, including the rectangle at the new > understand how to move a junk of the screen from one location to > another? I would appreciate whatever specificity you can provide > ... I really am a novice! position. The first, simplest way is to paint in the Picturebox' Paint event. Call it's Invalidate method to trigger the Paint event in the Timer's Tick event. Armin Why would you think bitblt is not supported. This is a Windows API function
and has nothing to do with the .net framework. I would guess that even the new Vista has support for the bitblt function since it is widely used as a basis for copying, moving, etc. pixels. -- Show quoteHide quoteDennis in Houston "fripper" wrote: > I am a real novice when it comes to the graphics class in VB 2005. I have a > windows app with a large picture box control with a black background ... > except for a small rectangle that has an image in it. A timer fires every > second or so and when it does I want to move the small rectangle within the > picture box to another location within the picture box. I don't want to > copy the rectangle ... I want to move it and have the vacated rectangle > revert to the black background. Now, this program is an upgraded version of > a VB .Net 2003 version I had written. In that version I used the bitblt > function to move this box but, as is so often the case, that function is not > supported in VB 2005. Can someone help me understand how to move a junk of > the screen from one location to another? I would appreciate whatever > specificity you can provide ... I really am a novice! > > Thanks. > > > The bitblt function (as I understand it) requires a device context paramater
(actually two ... one for the source and one for the destination). VB 2005 gives an error message when compiling a bitblt call with, say, picPic1.hdc, as the source device context parameter. According to the VB 2005 documentation device contexts are no longer necessary with GDI+. So the question remains ... How do I copy picPic1 to picPic2 using bitblt? Show quoteHide quote "Dennis" <Den***@discussions.microsoft.com> wrote in message news:D8C51462-27DD-4C60-86FB-B8C610030E88@microsoft.com... > Why would you think bitblt is not supported. This is a Windows API > function > and has nothing to do with the .net framework. I would guess that even > the > new Vista has support for the bitblt function since it is widely used as a > basis for copying, moving, etc. pixels. > -- > Dennis in Houston > > > "fripper" wrote: > >> I am a real novice when it comes to the graphics class in VB 2005. I >> have a >> windows app with a large picture box control with a black background ... >> except for a small rectangle that has an image in it. A timer fires >> every >> second or so and when it does I want to move the small rectangle within >> the >> picture box to another location within the picture box. I don't want to >> copy the rectangle ... I want to move it and have the vacated rectangle >> revert to the black background. Now, this program is an upgraded version >> of >> a VB .Net 2003 version I had written. In that version I used the bitblt >> function to move this box but, as is so often the case, that function is >> not >> supported in VB 2005. Can someone help me understand how to move a junk >> of >> the screen from one location to another? I would appreciate whatever >> specificity you can provide ... I really am a novice! >> >> Thanks. >> >> >> Maybe VB.Net 2005 provides a managed way to do this in .net code?
-- Show quoteHide quoteDennis in Houston "fripper" wrote: > The bitblt function (as I understand it) requires a device context paramater > (actually two ... one for the source and one for the destination). VB 2005 > gives an error message when compiling a bitblt call with, say, picPic1.hdc, > as the source device context parameter. According to the VB 2005 > documentation device contexts are no longer necessary with GDI+. So the > question remains ... How do I copy picPic1 to picPic2 using bitblt? > > "Dennis" <Den***@discussions.microsoft.com> wrote in message > news:D8C51462-27DD-4C60-86FB-B8C610030E88@microsoft.com... > > Why would you think bitblt is not supported. This is a Windows API > > function > > and has nothing to do with the .net framework. I would guess that even > > the > > new Vista has support for the bitblt function since it is widely used as a > > basis for copying, moving, etc. pixels. > > -- > > Dennis in Houston > > > > > > "fripper" wrote: > > > >> I am a real novice when it comes to the graphics class in VB 2005. I > >> have a > >> windows app with a large picture box control with a black background ... > >> except for a small rectangle that has an image in it. A timer fires > >> every > >> second or so and when it does I want to move the small rectangle within > >> the > >> picture box to another location within the picture box. I don't want to > >> copy the rectangle ... I want to move it and have the vacated rectangle > >> revert to the black background. Now, this program is an upgraded version > >> of > >> a VB .Net 2003 version I had written. In that version I used the bitblt > >> function to move this box but, as is so often the case, that function is > >> not > >> supported in VB 2005. Can someone help me understand how to move a junk > >> of > >> the screen from one location to another? I would appreciate whatever > >> specificity you can provide ... I really am a novice! > >> > >> Thanks. > >> > >> > >> > > >
array - how do you get the number of dimensions?
Resize problem (in IDE) Barcode Reader Application -- HELP New bee:How do i make an .exe file in VS 2005? DimeAttachment save to disk Com+ and asp.net? Connection Properties Dialog Box? Interface creation in VB.Net 2005 Flash (swf) in VB.net?? .NET 2.0 DataGridView |
|||||||||||||||||||||||