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.


ImageLib & Getpixel - bugs or user errors?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-24-2007, 12:26 AM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 118
Awards Showcase
Beta Tester 
Total Awards: 1
Question ImageLib & Getpixel - bugs or user errors?

I must be missing something

I've been playing with the Imagelib - you'll be able to work out why

I have 2 questions:
  1. Why does the form1.getpixel value change when I use exactly the same coordinates but from a sub?
  2. Why do i get an error if I change the "false" to "true" in drawer1.new1("Form1", false)?

You'll note that there is a workaround for the first problem in place. Change the if pixel = cBlack then to if form1.getpixel(x,y) = cBlack then to see the difference
Attached Files
File Type: zip Imagelibtest.zip (879 Bytes, 5 views)
Reply With Quote
  #2 (permalink)  
Old 05-24-2007, 05:48 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

It is better to leave Sub Globals for variables declarations only.
1. The second time you are using GetPixel is after drawing the purple circle.
So the color returned is the small circle color (cPurple).
2. If you want to draw on the forelayer, you need to first create it using:
Form1.ForeLayer = true
Reply With Quote
  #3 (permalink)  
Old 05-24-2007, 12:46 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

I too have had similar problems to this with one of my app's. I was finding that the colour of my image (say white for example) was not being detected as cWhite. When I checked the RGB values of cWhite and my white background I found they were different. As a work around I used GetPixel to obtain the RGB value for the background colour and stored this for use later.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 05-24-2007, 01:29 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Funny...
There are at least two color constatnt that should always be the same in whatever platform is used...cwhite=rgb(255,255,255);cblack=rgb(0,0,0)
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #5 (permalink)  
Old 05-24-2007, 06:05 PM
LineCutter's Avatar
Senior Member
 
Join Date: May 2007
Location: Daarsit
Posts: 118
Awards Showcase
Beta Tester 
Total Awards: 1
Talking

Quote:
Originally Posted by Erel View Post
It is better to leave Sub Globals for variables declarations only.
Agreed, they got moved there as part of the bug tracking attempt.
Quote:
Originally Posted by Erel View Post
1. The second time you are using GetPixel is after drawing the purple circle.
So the color returned is the small circle color (cPurple).
Quote:
Originally Posted by Erel View Post
2. If you want to draw on the forelayer, you need to first create it using:
Form1.ForeLayer = true
I knew I had to have missed something.

That makes the score Erel 4, Linecutter 0.
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
SQL errors skipper Questions & Help Needed 3 12-17-2007 10:51 AM
From.GetPixel on the Device alfcen Questions & Help Needed 4 07-11-2007 12:15 PM
Table errors Big JR Questions & Help Needed 8 06-09-2007 10:12 AM
ImageLib example - BouncingSmiley Erel Code Samples & Tips 0 05-20-2007 08:49 AM
Missing ImageLib.dll specci48 Bug Reports 1 05-19-2007 06:50 PM


All times are GMT. The time now is 12:56 PM.


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