Large Image in picture cannot be automatically shrink to Pic Control size?

Started by khann, November 28, 2013, 11:01:26 PM

Previous topic - Next topic

khann

Hi,  ::)
If there is a picture image of larger than the Pic Control size,
It cannot be shrink to fit the Pic Control?

Ex : a pic, (PicID num 100 in the picture list) has a size of H 200, W 300, and the Pic Control has a size of H 150, W 200.
I want the pic num 100 automatically fit to the size of Pic Control.

(dcl_PictureBox_LoadPictureFile formMH_PictureBox1 Filename [as String] {Stretch [as Boolean]})
dcl_PictureBox_LoadPictureFile has a "Stretch" option.
So the pictures in picture list?

Or am I missing any properties in Pic Control?

Thanks.

owenwengerd

I think you are correct that there is no way to rescale except by loading from a file.

Fred Tomke

Quote from: khann on November 28, 2013, 11:01:26 PM
Hi,  ::)
If there is a picture image of larger than the Pic Control size,
It cannot be shrink to fit the Pic Control?

Yes, you can. I do it that way:

  • When clicking an item, a "waiting"-icon is shown at the place were the image has to be drawn
  • A .NET background worker is called to create a new image by resampling the original one
  • When the backgroundworker has finished, an event is fired to show the image in the picturebox

All you need is to build a .NET backgroundworker or a resampler at all.
In the screenshot you see a picture of 6250x6250 pixels. It makes no sense to load it into picbox. That's why it is resampled to the current size of ppic box.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

khann

Thanks you , Owen and Fred, for the replies.
I just want to know some way to make it in Open DCL.
If I should and need, will ask you, Fred for more tips.

Thanks.  :D