dzImage

wolfgang

Member
Licensed User
Longtime User
Hi,
how to use FastPixelsStart and FastPixelsEnd? The helpfile doesn't help me.
 

agraham

Expert
Licensed User
Longtime User
The helpfile doesn't help me.
In what way doesn't it help :confused:
"Fast" methods using low-level techniques to achieve fast execution
-----------------------------------------------------------------


FastPixelsStart: This must be called before using any "Fast" method. Any number of "Fast" functions can then be called.


FastPixelsEnd: This must be called after using the last "Fast" method to unlock the image for further use.


FastGetPixel(x, y): Returns a byte array(4) with the values of the internal stored image's pixel data. "Dim Type(Alpha, Red, Green, Blue) pixel As byte".

FastSetPixel(x, y, alpha, red, green, blue): Set the values of the pixel data in position X,Y of the internal stored image to Alpha, Red, Green, Blue.


FastRotateImage(sourceImage, angle): Rotates an image. Angle can be any but 0, 90, 180, 270 are optimised. The empty space is filled with the colour of pixel(0,0) of the original image. Returns the rotated Image
 

wolfgang

Member
Licensed User
Longtime User
Hi,
I don't know how do I call this method (please write this line of code). I used FastRotateImage(sourceImage, angle) without any problem but I didn't call FastPixelsStart before. When I trie to call this method I always get an errormessage (because I'm doing wrong)???
 

wolfgang

Member
Licensed User
Longtime User
Hi Agraham, this is the example (6.30) from dz:
Sub Globals

End Sub

Sub App_Start
Form1.Show
dr.New1
End Sub


Sub Button1_Click
WaitCursor(True)
Image2.Image = dr.FastRotateImage(Image1.Image,TextBox1.Text)
WaitCursor(False)
End Sub


Sub Button2_Click
Image1.LoadPicture(AppPath & "\rotate.jpg")
Image2.Image = Image1.Image
End Sub


Sub Button3_Click
WaitCursor(True)
Image2.Image = dr.ZoomImage(Image2.Image, TextBox1.Text)
WaitCursor(False)
End Sub

I'm missing the lines with FastPixelsStart and FastPixelsEnd.
Everthing I tried gave me an errormessage. What must be written to call dr.FastPixelsStart?
 

Attachments

  • error.JPG
    error.JPG
    14.7 KB · Views: 10

agraham

Expert
Licensed User
Longtime User
If you want help you must post the source that is causing the problem together with any error messages. I can see from the error message that the line causing the error is not included in the source you have posted! Luckily I can also see from that error message that you are doing it wrong

B4X:
dr.FastPixelsStart
...
dr.Fastxxx ' do Fast things
...
dr.FastPixelsEnd
 

wolfgang

Member
Licensed User
Longtime User
Part of the "new" code:
.
.
.
Sub Button1_Click
WaitCursor(True)
dr.FastPixelsStart
Image2.Image = dr.FastRotateImage(Image1.Image,TextBox1.Text)
dr.FastPixelsEnd
WaitCursor(False)
End Sub
.
.
.
and errormessage. I tried everthing, always the same error. Maybe this works only on PPC?
 

agraham

Expert
Licensed User
Longtime User
Maybe this works only on PPC?
It does work on the PC. I assume you have the correct libraries as components for your app, the desktop library is different to the device.

I didn't write this library and don't have the source code but I did write the help from what the library appeared to do as the library author doesn't like doing documentation. I have looked inside the library with .NET Reflector and it seems that I have overlooked the significance of the names of FastPixelsStart and FastPixelsEnd. They are only needed if you are using FastGetPixel and FastSetPixel. They are not needed for FastRotateImage.

The reason for your error on FastPixelsStart is probably that there no image has been assigned to the Image property for FastPixelsStart to prepare for use.

Note that if you FastRotateImage the same image several times it gets larger and larger every time and the rotate slows down. It is not good practice to rotate an image more than once as rotating is a lossy process. If you want a different angle of rotation you should go back to the original image and rotate that.
 

ThMstr

New Member
Licensed User
Longtime User
They are not needed for FastRotateImage.

It seems to me that enclosing "FastRotateImage" in "FastPixelsStart" and "FastPixelsEnd" commands, prevents FastRotateImage from working...
 
Top