Basic4ppc - Windows Mobile Development  

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

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


Draw/Shapes


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-25-2007, 03:20 PM
Knows the basics
 
Join Date: Apr 2007
Location: Kindred,ND
Posts: 93
Default Draw/Shapes

This is a program using imglib, imglibex, and a txt file.
it saves image and loads img the only thing I have yet to learn is how to save a specific section of the screen. any help would be appreciated..The dlls are not in the zip.
Attached Files
File Type: zip button.zip (4.5 KB, 112 views)
Reply With Quote
  #2 (permalink)  
Old 09-25-2007, 04:28 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 575
Default

Hi bdiscount,

nice application but I'll receive an error choosing the menu option "back color" since the messagebox (line number 120) isn't implemented correctly.

And a small hint to "delete" the external text file by using the AddEvent command. Add the For/Next loop to you App_Start and additionally add the sub bcClick:
Code:
Sub App_Start
For i = 1 To 48 
    AddEvent("bc" & i, Click, "bcClick")
Next
fm1.show
img1.New1
act0(0)
drawer.New1("fm1",false)
End Sub

Sub bcClick
    fc0 = Control(Sender).Color
    c0.color=fc0
End Sub
Now the Draw10.txt is not needed any more!


specci48


Edit:
Since Erel seems to have read this post (suprprise, surprise...), he added a subject "runtime controls manipulation" in the tutorial forum Runtime controls manipulation. Just have a look at it for further explanation...

Last edited by specci48 : 09-26-2007 at 03:04 PM.
Reply With Quote
  #3 (permalink)  
Old 11-27-2007, 07:11 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default

1) Can anyone post the dlls I need to make this program work, as Im downloading this over the air to my device (not got pc here). Got it to load, and looked at the forms on it but it doesnt run yet???

2) Just curious- on the form two invisible boxes at the bottom ax ay - what r these for? I saw the same thing on another program?

3) Im not sure if this program does what Im also trying to do but
I want to draw a pic to an image box then save it as a file
(almost like having a bit map editor)
I tried image1.line & image1.circle but although it didnt error nothing happened

So can you draw to an image box and then save it as a file?

Thanks
Reply With Quote
  #4 (permalink)  
Old 11-28-2007, 02:08 PM
Knows the basics
 
Join Date: Apr 2007
Location: Kindred,ND
Posts: 93
Red face

As it says imagelibex.dll and imagelib.dll are used.
the ax and ay are array lists, used in drawing.
It will save the form as a bmp.
I have not been able to save a portin of the form to make it more usefull.
If you come up with away to save a portion let me know.
You should have got the dlls from here and or with B4ppc
Reply With Quote
  #5 (permalink)  
Old 11-30-2007, 02:34 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Default Format of bitmap files

Without using a library I want to write a routine to scan a pic and save it as a bitmap

Just out of ineterst does anyone know in a bitmap how many bytes is used for each pixel.

Now at first I thought 3,one each for R G B because they have 256 variants each.

But now I realise that PPC only shows 32 shades of each RGB, if u draw at say 9,9,9 it will round it to 8,8,8
So 32 options is 5 bits, so 15 bits in all (leaves 1bit redundant if 2 bytes are used)

Questions>
1) I assume bitmaps are not compressed (unlike jpgs)
2) What order are the pixels stored in the file (e.g.a row at a time starting from top to bottom)
3) Is there any header info in a bitmap file
Reply With Quote
  #6 (permalink)  
Old 12-04-2007, 11:30 AM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 448
Default

For all the information you need about the .bmp file format follow this link http://www.daubnet.com/formats/BMP.html
Its a handy site the Erel used for the IconEditor competition which can be found here Icon Editor - COMPETITION TIME this contains all sort of usefull links to icon related stuff.

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
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
How to draw a line on a panel? yildi Questions & Help Needed 6 02-29-2008 03:05 PM
Draw line on TabControl? Standa Questions & Help Needed 2 01-19-2008 10:38 AM
How to draw a line? RandomCoder Questions & Help Needed 3 08-24-2007 09:11 PM
Draw and Refresh faster hung Questions & Help Needed 3 08-01-2007 01:00 PM
How to draw into a Panel? BasicUser Questions & Help Needed 1 07-21-2007 06:28 AM


All times are GMT. The time now is 12:29 AM.


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