spelltwister
Programmer
Hey,
I was wondering if there is a way to grab only part of an image to use for a background image in a picturebox.
Here's what I mean:
I have a picture box called map that has dimensions 2000x1300. This map has 170 different sub sections that i have all the regions for. What I'm trying to do is spawn 170 pictureboxes and set their backgrounds to the appropriate sections of the map. I'm assuming it has to do with the .clip, but I can't get it to work.
Here's what I tried:
Dim bit As Bitmap = New Bitmap(map.Image)
Dim gmap As Graphics = Graphics.FromImage(bit)
gmap.Clip = New Region(regionPath)
picboxes(k).image = bit
The error is that it uses the upper left corner of the map always. It does not use the section that i want it to which makes no sense that it can even use that corner cause it should be cropped off.
Maybe I just don't know what the .clip actually does... :-/
Thanks
Mike
Online multiplayer strategy games huh? Try, 1483online.com where the games are FREE and the community drives enhancements to the game. ;-D
I was wondering if there is a way to grab only part of an image to use for a background image in a picturebox.
Here's what I mean:
I have a picture box called map that has dimensions 2000x1300. This map has 170 different sub sections that i have all the regions for. What I'm trying to do is spawn 170 pictureboxes and set their backgrounds to the appropriate sections of the map. I'm assuming it has to do with the .clip, but I can't get it to work.
Here's what I tried:
Dim bit As Bitmap = New Bitmap(map.Image)
Dim gmap As Graphics = Graphics.FromImage(bit)
gmap.Clip = New Region(regionPath)
picboxes(k).image = bit
The error is that it uses the upper left corner of the map always. It does not use the section that i want it to which makes no sense that it can even use that corner cause it should be cropped off.
Maybe I just don't know what the .clip actually does... :-/
Thanks
Mike
Online multiplayer strategy games huh? Try, 1483online.com where the games are FREE and the community drives enhancements to the game. ;-D