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.


Drawing a Image bigger then the screen


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2008, 12:26 PM
Knows the basics
 
Join Date: Jan 2008
Posts: 54
Default Drawing a Image bigger then the screen

Hi

I want to draw an Image bigger then the screen and have then scrollbars. I didn't found anything in the Treads. Someone can Help?

Georg
Reply With Quote
  #2 (permalink)  
Old 05-02-2008, 01:26 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

This code moves a large image by dragging the mouse (the file is also attached):
Code:
Sub Globals
    Dim x1,y1
    Dim maxX,maxY
End Sub

Sub App_Start
    Form1.Show
    drawer.New1("form1",false)
    bmpMap.New1("pic.jpg") 'Loads the image to a Bitmap object
    rectDest.New1(5,5,form1.Width-10,form1.Height-10) 'The form's rectangle
    rectSrc.New1(0,0,rectDest.Width,rectDest.Height) 'The bitmap's rectangle
    maxX = bmpMap.Width - rectDest.Width
    maxY = bmpMap.Height - rectDest.Height
    DrawMap
End Sub

Sub Form1_MouseDown (x,y)
    x1 = x
    y1 = y
End Sub

Sub Form1_MouseUp (x,y)
    RectSrc.X = Min(maxX,Max(RectSrc.X - x + x1,0)) 'Checks the bounds and updates the coordinates
    RectSrc.Y = Min(maxY,Max(RectSrc.Y - y + y1,0))
    DrawMap
End Sub

Sub DrawMap
    drawer.DrawImage1(bmpMap.Value,rectSrc.Value,rectDest.Value,false)
    drawer.Refresh2(rectDest.Value)
End Sub
Attached Files
File Type: zip Map.zip (51.0 KB, 42 views)
Reply With Quote
  #3 (permalink)  
Old 05-02-2008, 01:38 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

This puts a big image on a smaller panel and uses the Door library to activate the Panel scroll bars.
Attached Files
File Type: zip BigImage.zip (110.4 KB, 34 views)
Reply With Quote
  #4 (permalink)  
Old 05-02-2008, 01:55 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 819
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

You can also have a look at this.

Display maps

Best regards
__________________
Klaus
Switzerland
Reply With Quote
  #5 (permalink)  
Old 05-02-2008, 02:44 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 819
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi Andrew,

I had a look at your example. In this case are the LargeChange, SmallChange and Value parameters also accessible and be changed ?

The landing of the F111 is somewhat risky, isn't it ?

Thanks in advance
__________________
Klaus
Switzerland
Reply With Quote
  #6 (permalink)  
Old 05-02-2008, 03:05 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by klaus View Post
I had a look at your example. In this case are the LargeChange, SmallChange and Value parameters also accessible and be changed ?
Yes, they should be accessible through the HorizontalScroll and VerticalScroll properties of the Panel which are HScrollProperties and VScrollProperties types respectively. If you walk the Docs for Panel you should see them and their members.

Code:
pnl1obj.FromControl("Panel1")
pnl1obj.SetProperty("AutoScroll", true)
hscrollobj.value = pnl1obj.GetProperty("HorizontalScroll") ' returns an HScrollProperties type
hscrollobj.SetProperty("LargeChange", 20)

Quote:
The landing of the F111 is somewhat risky, isn't it ?
It's an Autralian one that sustained undercarriage damage on takeoff. They nearly dumped it in the sea but opted to belly it in after lightening it as much as possible. Surprisingly little damage was caused apparently!
Reply With Quote
  #7 (permalink)  
Old 05-02-2008, 03:07 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 819
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thanks Andrew,
I will use this in my Map display program

Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #8 (permalink)  
Old 05-25-2008, 06:15 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 819
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi Andrew,

Following my previous question, is it possible to add the ValueChanged event to the panel's scrollbars and of course how?
I did not succeed yet.

Thank you in advance and Best regards.
__________________
Klaus
Switzerland
Reply With Quote
  #9 (permalink)  
Old 05-26-2008, 10:30 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by klaus View Post
is it possible to add the ValueChanged event to the panel's scrollbars
Unfortunately it looks like no .

The Door library can see two scroll bar property objects but not the scroll bars themselves. This is because the Panel is a native control, and so are its' scroll bars and the scroll bars are not exposed as .NET controls - only the Panel itself is. There is a Scroll event for the panel for the desktop but not on the device. However even on the desktop this event can't be used as the Door library doesn't know about the ScrollEventHandler object which this event returns.
Reply With Quote
  #10 (permalink)  
Old 05-26-2008, 11:05 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,900
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by agraham View Post
Unfortunately it looks like no
Actually

Using the dzEventsMagic library


EDIT : Note that if you want to try this on the device that Line 14 should be changed to "MouseDown", as a Panel does not have a MouseClick event on the device, and lines 19,20 and 21 removed as on the device a Panel does not have HorizontalScroll and VerticalScroll properties. The scroll events will work.
Attached Files
File Type: zip BigImageScroll.zip (118.2 KB, 27 views)

Last edited by agraham : 05-26-2008 at 03:56 PM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
karmba_a
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
a bigger SQL sample and/or tutorial ? SpaceCruiser Questions & Help Needed 1 06-14-2008 09:54 PM
Drawing on image control derez Basic4ppc Wishlist 10 01-16-2008 05:51 PM
bigger menu Zemog Questions & Help Needed 3 07-21-2007 06:02 PM
Drawing parts of a large image. Erel Code Samples & Tips 0 06-07-2007 09:07 AM
Move an image inside an image control Cableguy Questions & Help Needed 5 05-14-2007 08:40 PM


All times are GMT. The time now is 07:51 PM.


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