I think I know what I need to do now in order to scale my images quickly without having a polygon drawn on top of them scale with it, but I'm not quite there yet and I'm hoping someone knows what I should do.
This is what I think I should do:
1. Create a hidden canvas at the full size of my image. Blit image I have loaded to it normally.
2. Create a bitmap at the same size as the canvas.
3. Get the device context of the canvas using GetDC().
4. Use Bitblt to copy the image from the canvas's device context to my bitmap.
5. Create a bitmap at the scale I want my final image to be at.
6. Use StretchBlt to blit the image from the first bitmap to the second, scaling it up or down.
7. Draw my non-scaled polygon onto this image using SetPixelV().
8. Create a bitmap that will actually be displayed on the screen. Make this a child of the panel I want to display my image in.
9. Blit the scaled bitmap that I created in step 5 to the visible bitmap I just created. I do this instead of displaying the scaled bitmap because the scaled bitmap won't have the polygon drawn on it at all times and it could cause the polygon to flicker if sometimes the bitmap is updated and it doesn't have the corrrect final appearance.
Now my problem here is when I say bitmaps, I'm not sure if I mean bitmaps, or maybe a "device context in memory" or what.
I also don't know which type of bitmap to use. I need something that will work regardless of whether the user is in 24bit color, or 16bit color. But my program will always work internally with 24bit color so I want to be able to always write 24bit color out to these bitmaps.
Here are some links to some information I was looking at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7e2b.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_0c1f.asp
I hope someone here has dealt with coding windows stuff before and knows what I should do here.
This is what I think I should do:
1. Create a hidden canvas at the full size of my image. Blit image I have loaded to it normally.
2. Create a bitmap at the same size as the canvas.
3. Get the device context of the canvas using GetDC().
4. Use Bitblt to copy the image from the canvas's device context to my bitmap.
5. Create a bitmap at the scale I want my final image to be at.
6. Use StretchBlt to blit the image from the first bitmap to the second, scaling it up or down.
7. Draw my non-scaled polygon onto this image using SetPixelV().
8. Create a bitmap that will actually be displayed on the screen. Make this a child of the panel I want to display my image in.
9. Blit the scaled bitmap that I created in step 5 to the visible bitmap I just created. I do this instead of displaying the scaled bitmap because the scaled bitmap won't have the polygon drawn on it at all times and it could cause the polygon to flicker if sometimes the bitmap is updated and it doesn't have the corrrect final appearance.
Now my problem here is when I say bitmaps, I'm not sure if I mean bitmaps, or maybe a "device context in memory" or what.
I also don't know which type of bitmap to use. I need something that will work regardless of whether the user is in 24bit color, or 16bit color. But my program will always work internally with 24bit color so I want to be able to always write 24bit color out to these bitmaps.
Here are some links to some information I was looking at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/devcons_7e2b.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_0c1f.asp
I hope someone here has dealt with coding windows stuff before and knows what I should do here.