|
-
Jan 24th, 2008, 11:55 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Best method for drawing to picturebox
I use VB6.
I am drawing to a 1000x1000 picturebox with different colours based on areas of a map. I am trying to work out the fastest way to draw this pixel by pixel.
At the moment I am using setpixel, which is okay if I am not zoomed in but when I zoom in it not only takes serious amounts of time, but also memory and it crashes with the "can't create AutoRedraw image" error (meaning the buffer's too large)..BTW zooming in multiplies the picturebox size because of what I am doing, so 3x zoom is a 3000x3000 picturebox.
I have tried using BitBlt but I can't seem to work out how to draw specific colours to each pixel with it if at all possible. I've realised I *could* have a legend and have BitBlt grab the image from there to paste onto my map, and I might have to do that if I can't find a better solution.
I have uploaded a sample of a zoomed in (4x zoom so each box is 3x3 with a black border) at http://i10.photobucket.com/albums/a117/SmUX/sample.gif
Has anyone got any thoughts or suggestions for the best way to achieve this? Hopefully with some code or link to where to learn about it :-)
Is there any way to draw squares of a specific colour to a specific point of a picturebox, perhaps?
Last edited by smUX; Jan 24th, 2008 at 11:58 AM.
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|