|
-
Aug 20th, 2002, 01:29 PM
#1
Thread Starter
New Member
writing and reading a line of picture points
I have a program that reads a bmp picture file
manipulates it and writes it back out to the screen
I am using point and pset, which is very slow
I wrote a faster version that uses picture.line to write
(if the color is the same for consecutive points)
otherwise it uses pset
There must be a way to do a SINGLE operation to
read and write multiple picture points into an long array
i.e. a full line of points
I would think this would speed things up concerably
anybody have something that does this
Bitblt may do this with all the "proper setup"
Last edited by shaversm; Aug 20th, 2002 at 03:31 PM.
smshaver
-
Aug 20th, 2002, 05:04 PM
#2
Junior Member
There is probly a faster way, however,
Instead of pSet, use SetPixelV instead. It's much faster itself and will speed up the routine.
(also included getPixel)
'===================================================================
'SetPixel function used to set a pixel on an hDC.
'-------------------------------------------------------------------
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, _
ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
'===================================================================
'GetPixel gets a pixel from hDC, generaly used for effects in this class
'-------------------------------------------------------------------
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, _
ByVal X As Long, ByVal Y As Long) As Long
'example, pixel plotting on the form:
SetPixel Me.hdc, 100, 100, RGB(255, 0, 0)
would set a pixel on the form at x = 100, y = 100, with red color.
simple and fast 
Hope that helps.
-
Aug 21st, 2002, 04:02 PM
#3
Fanatic Member
which is faster/better setpixel or setpixelV currently i use setpixel
(what happened to setpixelII-IV
-
Aug 21st, 2002, 04:28 PM
#4
New Member
why not just use bitblt to get areas of the picture you want it?
i find it faster then get/set pixel
-
Aug 21st, 2002, 06:09 PM
#5
PowerPoster
Because, when using BitBlt, you can't manipulate the pixels... the fastest method, however, would be to copy the picture into a Ayte array, manipulate, and copy it back.
-
Aug 21st, 2002, 07:03 PM
#6
Good Ol' Platypus
SetPixelV stands for SetPixel that doesn't return the Value.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
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
|