Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Nov 21, 2019 3:08 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Resizing Image as Window Backdrop
PostPosted: Thu Feb 24, 2011 4:16 pm 
Offline

Joined: Thu Apr 26, 2007 7:29 am
Posts: 242
Location: Middlebury, CT
Hi,

I was wondering if anyone knew a solution to properly resizing an image that is being used as a backdrop in a Window.

I have an image loaded as a background in a window and I want the image to resize when the window is resized. I have the following code in the Paint event of the window.


g.DrawPicture(myimage, 0, 0, g.Width, g.Height, 0, 0, myimage.Width, myimage.Height)


This works like a champ on a Mac but under Windows it does not work correctly. The image distorts when the window is resized and is not refreshed.

Does anyone know what I could do to make this work correctly?

Any help would be appreciated.

Jim


Top
 Profile  
Reply with quote  
 Post subject: Re: Resizing Image as Window Backdrop
PostPosted: Thu Feb 24, 2011 4:26 pm 
Offline

Joined: Sat Oct 01, 2005 5:19 pm
Posts: 3216
I can't figure out how that doesn't distort on a Mac unless the window is being scaled the same in height and width every time it's resized.

If you have a window that's 800X600 and the user makes it 1000X600 how can the picture not distort?


Top
 Profile  
Reply with quote  
 Post subject: Re: Resizing Image as Window Backdrop
PostPosted: Thu Feb 24, 2011 4:35 pm 
Offline

Joined: Thu Apr 26, 2007 7:29 am
Posts: 242
Location: Middlebury, CT
I don't mean scale, I mean actually distort. It is redrawing the image without erasing the last image as you drag and resize the window. So if there is a tree in the picture, there will be a whole line of trees when you resize the window by dragging it.

Jim


Top
 Profile  
Reply with quote  
 Post subject: Re: Resizing Image as Window Backdrop
PostPosted: Thu Feb 24, 2011 4:40 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
Knightlite wrote:
I don't mean scale, I mean actually distort. It is redrawing the image without erasing the last image as you drag and resize the window. So if there is a tree in the picture, there will be a whole line of trees when you resize the window by dragging it.

Jim

Not sure if it will solve your problem, but you could try putting a 'me.refresh' in the 'resized' event of the window. I recall adding that in one of my applications to solve a similar issue.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Resizing Image as Window Backdrop
PostPosted: Thu Feb 24, 2011 4:52 pm 
Offline

Joined: Thu Apr 26, 2007 7:29 am
Posts: 242
Location: Middlebury, CT
Thanks Mark!!!!

That did the trick. That solved the problem. Still get flicker, but I doubt there is a solution to that.

I appreciate the help. Thanks again. :-)

Jim


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group