News: Now it is possible to use the zoom
and the line
I will describe a problem I was dealing with, and how I solved it. When the user select part of the image it wants to edit, the program execute two operations: create the profile image and create a paint control(a windows handle);
Previously, the program was setting the size of the Paint control
to the same size of the Profile image
, what give us this result:
This process create 3 images: the Original image
, in the right frame(in the first picture); the Profile image
; and the Paint control
with a visible area and a non-visible area(in the second picture).
Well, it works fine... if you have a advanced computer. Yes. because if you are dealing with a large image, like 3000x3000, the program may crash on "lowtech"(like mine
). And, if you select a large image, then you will have a 3000x3000 image, and a large
Profile image and Paint control(because the paint control is setted to the same size).How I solved
Instead of set the paint control to the same size, the program draws in the paint control only part of the image we will need, using BitBlt function(WinAPI function). Now the computer don't spend memory with that non-visible area, just the visible one.Done!
It is a simple process to use with games(In my case, it was a hardcore programming experience, because... a lot of variables... the zoom tool, the mouse position, where the pixels would be put when clicked).
I will make it so good, I will see people here using this program! Challenge Accepted!
"Life finds a way." - Ian MalcolmMy WebBlog: PixelDeveloper
English is not my native language, so excuse me for any writing mistakes.