Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Image Preview?

Author
Message
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 30th Jun 2009 07:58
I have a bunch of 512x512 texture files loaded, img 1-30.

Is there a way to make a small 64x64 or 128x128 version of that image onto the screen as sort of like a preview?

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 30th Jun 2009 13:28
might be possible with scale sprite and paste it to the screen.

Dark Physics makes any hot drink go cold.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 30th Jun 2009 15:45
That what I thought too, although you have a couple of options, depending on what you are doing..

1) Make a sprite from the image, scale it and paste it where you want it...

2) Make the image a bitmap and render it to a texture on an object/plain and position it where you want it

3) Use some form of interpolation algorithm to reduce it pixel by pixel(although that method has alot of overhead, is complex to implement and is probably not what you are after for a "preview" type image, its more used for "best quality" image size reduction. Essentialy, each pixel of your destination image is represented by the interpolation of the colors of x number of pixels in the source image. The exact amount depening on the nature of the algorithm used, bilinear, nearest neighbour etc...

If it ain't broke.... DONT FIX IT !!!
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 1st Jul 2009 00:37 Edited at: 1st Jul 2009 00:38
I'll just turn it into a sprite and scale it
EDIT:
can i create the sprite, scale it, hide it, then wherever i paste it it will be small scale?

Ian G
16
Years of Service
User Offline
Joined: 3rd Jun 2008
Location: SSM, Canada
Posted: 1st Jul 2009 00:56 Edited at: 1st Jul 2009 01:05
Yes. An extension of this is to paste the sprite onto a bitmap and get that image so you don't have to have the full texture loaded into memory.

This function is from the BlueGUI examples:
This is DBP code, but the principle is still the same


Basic GDK code


In this case, it uses bitmap 0 (the default bitmap) however you could easily create a new bitmap and then paste the sprite to that and grab its image if you needed to.
Phosphoer
16
Years of Service
User Offline
Joined: 8th Dec 2007
Location: Seattle
Posted: 1st Jul 2009 01:05
Yes, I think you can even scale in between pasting operations and get differently sized images from the same sprite.

Login to post a reply

Server time is: 2024-10-01 05:47:50
Your offset time is: 2024-10-01 05:47:50