Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips > Additional Libraries
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.


dzImage Library


Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 12-26-2007, 10:49 AM
Senior Member
 
Join Date: May 2007
Posts: 152
Awards Showcase
Competition Winner 
Total Awards: 1
Default Features

I like your attitude to problems.
I thought that if the user is in a hurry - he can display the map shrinked in the going direction and thus arrive earlier...
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #12 (permalink)  
Old 12-26-2007, 11:11 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Default

That's exactly the idea. Glad we share the same sense of humor.
Best luck with your project, David.
Reply With Quote
  #13 (permalink)  
Old 12-26-2007, 05:58 PM
Senior Member
 
Join Date: May 2007
Posts: 152
Awards Showcase
Competition Winner 
Total Awards: 1
Default Size

Dimitris

I succeeded also in getting the size of the map by adding it to an ImageList, like you said
Thanks again.

your next challenge is to make the rotation for an arbitrary angle...
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 12-26-2007 at 06:01 PM.
Reply With Quote
  #14 (permalink)  
Old 12-26-2007, 09:25 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 507
Awards Showcase
Competition Winner 
Total Awards: 1
Default

Hello dzt
I have tried the dzImage.dll great job.
I encountered a problem which happens also in your test2.sbp program
if in line 39 you change
dr.ScreenCapture2(10,10, 100, 100)
to
dr.ScreenCapture2(10,10, 99, 100)
I get an error.
The same happens with
dr.ControlCapture("Button1", 0,0,Button1.Width, Button1.Height)
if you set the Button1.Width to less then 100

It seems that both functions don't accept Widths less than 100.

Can you please check it.

Do you intend to add SaveICO for icons.
And why not LoadICO ?
I would be interested in because I am writing an Icon Editor.
I just added a screenshot that shows the beginning, I ditn't add the code because there is still a lot to add and test.

Thank you in advance
Klaus
Switzerland
Attached Images
File Type: jpg IconEdit.jpg (28.3 KB, 26 views)

Last edited by klaus : 01-16-2008 at 11:17 AM.
Reply With Quote
  #15 (permalink)  
Old 12-27-2007, 11:11 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Hi,

The third version of dzImage is here.

Corrected the problem pointed by Klaus (thank you) regarding Capture2 and ControlCapture when Width < 100

Added some new methods.
ImageToByteArray(Image): Returns an array of bytes which contains the whole Image.
ByteArrayToImage(byte()): Converts the valid (must be) byte() to an Image.
GetPixel(X, Y): Returns a Dim Type(Alpha, Red, Green, Blue) with the attributes of the internal stored image's piointed pixel.
SetPixel(X, Y, Alpha, Red, Green, Blue): Set the pixel in postion X,Y of the internal stored image to Alpha, Red, Green, Blue.

And a modification.
RotateImage(Image, angle) can now accept any angle (be careful of the image size, because angles different from 90, 180, 270 makes this method acting slowly)

In the attached sip is included a sample showing the new additions.

EDIT:
Next Year I'll try to make GetPixel and SetPixel much faster (RotateImage too as it is based on them)
Attached Files
File Type: zip dzImage_03.zip (12.8 KB, 38 views)
__________________
Dimitris Zacharakis
http://www.terracom.gr

Last edited by dzt : 12-27-2007 at 11:19 PM.
Reply With Quote
  #16 (permalink)  
Old 12-28-2007, 02:57 PM
Senior Member
 
Join Date: May 2007
Posts: 152
Awards Showcase
Competition Winner 
Total Awards: 1
Default Rotation

Thanks for the effort, but I found it unusable for my program because it is doing the rotation but it takes a lot of time (as expected).
The problem is that I understand the difficulties but I also have an application that does it in real time and I don't know how the creator of that application did it
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #17 (permalink)  
Old 12-28-2007, 04:19 PM
Senior Member
 
Join Date: May 2007
Posts: 152
Awards Showcase
Competition Winner 
Total Awards: 1
Default

Also due to different distance between pixels in x and y, when rotated the result image is distoted in angles. see the example , where I took just part of the whole form and rotated it.
Attached Images
File Type: jpg rot.JPG (25.2 KB, 30 views)
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #18 (permalink)  
Old 12-28-2007, 08:27 PM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Hi,

Attached is the forth version of dzImage.

Added:
FastGetPixel, FastSetPixel, FastRotateImage

For how to use them see the included in the zip sample.
Next Update (if there will be) at 2008 for shure.

Quote:
The problem is that I understand the difficulties but I also have an application that does it in real time and I don't know how the creator of that application did it
You should realize that we both do not use the fastest development tools and technologies available.

Quote:
Also due to different distance between pixels in x and y, when rotated the result image is distoted in angles. see the example , where I took just part of the whole form and rotated it.
Your rotated image is wider than your form. So it is displayed distorted. Try DrawImage or use an Image Control.
Attached Files
File Type: zip dzImage_04.zip (24.3 KB, 40 views)
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
  #19 (permalink)  
Old 12-29-2007, 12:47 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Default

Hi David,
As far as I am aware, commercial GPS maps are vector graphics that can
be stretched virtually indefinitely. Rotation angles on bitmaps other than
quarters need adjustment, especially for text. A true challenge, indeed.

Haisai Dimitris,
Congrats! Your latest 'magic' adds further, indispensable value to Basic4ppc.
I have already constructed a viewer application for sky photos including a
magnifying glass on selected coordinates. Of course, it also flips and flops,
rotates, zooms in and out. Reminds me on those days with VB3.0 and BitBlt.

Works lovely and I have encountered just three minor findings (errors
inherent to human programmer can not be excluded):

1. Rotation Angle 0 blacks out the screen or image control.
2. While running fine in the IDE, the exe sometimes prompts
"Invalid Pixel Format" error upon InvertImage.
3. Also upon Invert, the desktop shows correct, while the device does
not invert (perhaps I am seeing things the wrong way round).
I have a master image in an Image Control (mode = cNormalImage) and draw
a manipulated image on a form using DrawImage or to another Image Control.

All can be worked around fairly easily. Since 2007 is fading into history,
let's preserve this issue for 2008

Thanks so much for this wonderful year-end present!
Cheers
Robert
Reply With Quote
  #20 (permalink)  
Old 12-29-2007, 11:10 AM
dzt's Avatar
dzt dzt is offline
Basic4ppc Veteran
 
Join Date: May 2007
Location: Greece
Posts: 353
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Quote:
Originally Posted by klaus View Post
I would be interested in because I am writing an Icon Editor.
I just added a screenshot that shows the beginning, I ditn't add the code because there is still a lot to add and test.
Looks like a professional job. I thinks that my friend Robert (alfcen) finally found a competitor in design skills.

Quote:
Originally Posted by klaus View Post
Do you intend to add SaveICO for icons.
And why not LoadICO ?
You can load an Icon using LoadPicture of various controls (Image, Form etc.)
To save an Icon you need deep knowledge of the ico format. Take a look at this thread Icon Editor - COMPETITION TIME

dzImage.ImageToByteArray might can help. The first 54 bytes are BITMAPINFOHEADER (40 bytes) and BITMAPFILEHEADER (14 bytes. Next bytes represents the actual image. Take a look here
http://www.fortunecity.com/skyscrape.../bmpffrmt.html
and here
http://www.cs.uvm.edu/~erickson/educ...b_bmp/BMP.html
__________________
Dimitris Zacharakis
http://www.terracom.gr
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Door library (Beta) - Special library Erel Official Updates 48 07-18-2008 02:33 PM
Merging Outlook library and Phone library Erel Official Updates 2 07-14-2008 03:38 PM


All times are GMT. The time now is 05:34 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0