Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


From.GetPixel on the Device


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-11-2007, 10:49 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default From.GetPixel on the Device

Is anyone aware of a problem with From.GetPixel() on the device?
The following routine works great on the dektop, however on the PPC all circles are drawn in white. The o/s of the PPC is PPC2003 though.

If pos > 3 And pos < 3.3 Then
If frmGalilean.GetPixel(px,py)=cYellow Then
frmGalilean.Circle(px,py,1,cYellow ,F)
else
frmGalilean.Circle(px,py,1,cWhite,F)
end if
Else
frmGalilean.Circle(px,py,1,cWhite,F)
End If

By the way, could a Form.SetPixel command be added to to future version?
Thanks a lot!
Reply With Quote
  #2 (permalink)  
Old 07-11-2007, 10:56 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

As the device supports only 65k colors some values may change a little bit.
Add a msgbox before your code:
Msgbox("GetPixel color: " & frmGalilean.GetPixel(px,py) & crlf & "cYellow: " & cYellow & crlf & "cWhite: " & cWhite)
What values do you get? (note that cWhite and cYellow are constants)
Reply With Quote
  #3 (permalink)  
Old 07-11-2007, 11:18 AM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thank you very much, Erel.
Yep, the device provides 'only' 65k colors.
I will check them on the device as you suggested.
Cheers
Robert
Reply With Quote
  #4 (permalink)  
Old 07-11-2007, 11:20 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,132
Default

One way to solve this problem is to save the color of a known "yellow" colored pixel and then compare the GetPixel with this color.
Reply With Quote
  #5 (permalink)  
Old 07-11-2007, 12:15 PM
alfcen's Avatar
Basic4ppc Veteran
 
Join Date: Apr 2007
Location: Okinawa, Ryukyu
Posts: 424
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Hi Erel,
Your second approach did the trick.
This works for both, desktop and PPC:

If pos > 3 And pos < 3.3 Then
If frmGalilean.GetPixel(px,py)=frmGalilean.GetPixel(x 0,y0) Then
frmGalilean.Circle(px,py,1,cYellow ,F)
else
frmGalilean.Circle(px,py,1,cWhite,F)
end if
Else
frmGalilean.Circle(px,py,1,cWhite,F)
End If

Obviously, on the PPC, I must not use the color of a coordinate exactly onto which the circle is to be drawn. Don't ask me why

Anyway, thanks so much for your prompt attention.

Cheers
Robert
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
Problem of Getpixel on PocketPC 2000 and PocketPC 2003 hung Bug Reports 3 08-21-2007 02:46 AM
ImageLib & Getpixel - bugs or user errors? LineCutter Questions & Help Needed 4 05-24-2007 06:05 PM


All times are GMT. The time now is 07:35 AM.


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