VB6 - Breaking up an image?
I made a game called slider where you move pieces of an image around to make the full image, and right now I just have 9 different images (8 pieces and the full). I was wondering, is there a way to break up a full image into smaller pieces? Example, here's a screen of what I have now:
http://img237.imageshack.us/img237/5798/s22vg2.png
Thanks :)
Re: VB6 - Breaking up an image?
The easy way. Are you familiar with VB's PaintPicture function? Once you have an image loaded into a picturebox with its AutoRedraw & AutoSize set to true, you can divide the width/height by 3. Then you can use PaintPicture to draw the portions to 8 other picture boxes.
That was the easy way, maybe not the best and maybe not suited for your needs.
Re: VB6 - Breaking up an image?
Alright, thanks. I'll do some research on PaintPicture.
Edit: What exactly is an image's scalewidth and scaletop etc?
Re: VB6 - Breaking up an image?
You can load the complete image into a PictureClip control and set the Rows = 3 and the Cols = 3 to give you the 9 segments that you need.
Re: VB6 - Breaking up an image?
Quote:
Originally Posted by MountainDew7
Edit: What exactly is an image's scalewidth and scaletop etc?
Images don't have scalewidth, scaletop, etc. The form & many controls (picturebox for example) do have these properties. They are the inside dimensions of the object vs the outside dimensions. The only time both will be the same is if the control is borderless, otherwise, the outside dimensions will always be bigger. Now, ScaleMode is important. Personally, I always find that when working with graphics, change the scalemode of graphical controls to vbPixels vs the default vbTwips. Pixels are more human-friendly in my opinion. To convert between 2 different scalemodes, one would use the ScaleX and ScaleY functions.
Re: VB6 - Breaking up an image?
The pictureclip was so easy to work, thanks :)
But now, how can I get a thing to pop up where I pick a file in the middle of running the program?
Re: VB6 - Breaking up an image?
PictureClip is a nice control, but it still is a separate file that you will need all the time for your application to work.
I personally try and use API's instead of relying on other controls.
I'd recommend you use BitBlt API which could do the same thing as the PicClip so you wouldnt need any external files.