FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using PictureBox with STRETCH_IMAGE Mode

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
peter



Joined: 05 Jun 2007
Posts: 7
Location: Germany

PostPosted: Tue Jun 05, 2007 8:58 am    Post subject: Using PictureBox with STRETCH_IMAGE Mode Reply with quote

Hi,

I am quite new to the D-Language, so please apologize if this question is silly.

I tried to change the pictureviewer example from the dfl package to be able to stretch or shrink an image.

Therefor I modified the source the following way .


private import dfl.all;
class PictureForm: Form
{
PictureBox pic;

this()
{
startPosition = FormStartPosition.WINDOWS_DEFAULT_BOUNDS;
text = "DFL Picture Viewer";
backColor = SystemColors.appWorkspace;

with(pic = new PictureBox)
{
// sizeMode = PictureBoxSizeMode.AUTO_SIZE;
sizeMode = PictureBoxSizeMode.STRETCH_IMAGE;
parent = this;
}


It compiles without errors, but is no longer able to load any image.

What do I do wrong ?

What I would like to do in my application is to load and show an image and
then give the user the possibility to zoom and to scroll this image.

Thanx for any help.


As a C, VB and Java Programmer, I was searching for a language
being fast (Compiler), with OOP and RAD and I think D is an excellent choice.
_________________
Smile
Back to top
View user's profile Send private message
cracki



Joined: 07 May 2007
Posts: 10
Location: Germany

PostPosted: Tue Jun 05, 2007 9:39 am    Post subject: Reply with quote

you need to set the docking of `pic` to FILL

see there for more
http://wiki.dprogramming.com/DflDoc/HomePage


please don't use classes just because you can.
there is no reason why you need a new class for a form that happens to have a picturebox on it.
_________________
...meh...
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Jun 05, 2007 12:41 pm    Post subject: Reply with quote

cracki, I do recommend deriving from Form. It's just easier when you decide to add event handlers, you automatically have a place to put them.
Back to top
View user's profile Send private message
peter



Joined: 05 Jun 2007
Posts: 7
Location: Germany

PostPosted: Tue Jun 05, 2007 3:05 pm    Post subject: Using PictureBox with STRETCH_IMAGE Mode - working Reply with quote

Hi cracki,

thanx for the help

with DockStyle FILL it works.


with(pic = new PictureBox)
{
sizeMode = PictureBoxSizeMode.STRETCH_IMAGE;
dock = DockStyle.FILL;
parent = this;
}


I have read the picturebox entry and more at http://wiki.dprogramming.com/DflDoc
but for a newbie it is quite hard.

However, is there any more documentation about DFL ?
_________________
Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group