Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.

SetPixels

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2010, 01:18 PM
Knows the basics
 
Join Date: Jul 2010
Location: St.Petersburg
Posts: 59
Talking SetPixels

Hello.
I played with the ImageLib a little.
Just copy the color values of a bitmap to a textfile and redraw it anywhere.
Some may find it interesting.
Criticism is welcome.
Attached Files
File Type: zip SetPixels.zip (17.6 KB, 65 views)

Last edited by Monsterman22 : 07-24-2010 at 02:30 PM. Reason: missing letter
Reply With Quote
  #2 (permalink)  
Old 07-25-2010, 07:11 AM
Knows the basics
 
Join Date: Jul 2010
Location: St.Petersburg
Posts: 59
Default

Still I don't understand why SetPixel doesn't work at Button_click :

Sub Button_click
Bitmap.SetPixel(x,y,color)
End Sub

???
Reply With Quote
  #3 (permalink)  
Old 07-25-2010, 08:26 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Probably because the form doesn't know the bitmap has changed and doesn't redraw it. Try Form.Refresh to redraw the whole form or Drawer.Refresh to redraw the part that has changed.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #4 (permalink)  
Old 07-25-2010, 09:12 AM
Knows the basics
 
Join Date: Jul 2010
Location: St.Petersburg
Posts: 59
Default

Quote:
Try Form.Refresh to redraw the whole form
It works

Button_Click
Bitmap.SetPixel(X,Y,color)
Form1.Refresh
Form1.DrawImage(Bitmap.Value,0,0,100,100)
End Sub
Reply With Quote
  #5 (permalink)  
Old 07-25-2010, 09:16 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

You probably don't actually need the Refresh as you are doing a DrawImage after altering the bitmap which propbably does an automatic refresh. Try it and see.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #6 (permalink)  
Old 07-25-2010, 10:01 AM
Knows the basics
 
Join Date: Jul 2010
Location: St.Petersburg
Posts: 59
Default

Yes you are right Refresh is not needed
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 Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 10:50 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0