how to display a xcache image rotate

Help each other out

how to display a xcache image rotate

Postby alamata on Thu Apr 24, 2008 2:09 pm

hey,

i discover the possibilities of xdatabase
and particuraly at this moment
the xcache settings

i would like to make a rotation of the coverart
of the category music

but i have encourred some difficulties... :oops:

i have try to modify the ini file

but no succes...

can you give me some indications
about the way to realise this thing...

i have read the thread of xdatabase and have seen the notes
but .... :roll:

thanks for your comprehension...
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: how to display a xcache image rotate

Postby S Pittaway on Fri Apr 25, 2008 7:40 am

the cache stuff was really for my use i just left it there in case... :)

for any of the cache functions to work the plugin make a copy of ALL of the coverart in the database you are interested in. This is not very disk disk efficient and can "waste" several hundred MB of space. But kisks are cheep and diska are big so i dont really care.

if you only want to "rotate images" the xcache stuff is pprobably not what you want.

After saying all of that, what are you trying to do in the ini file and whats causing you problems?




If you simply want a rotate image function i can add it in (i have the code in the plugin)?

i did not because of the lossy rotation on jpegs (unless the width/height are divisible by 16), having said that it will be no worse than hitting rotate in the windows slideshow viewer?
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how to display a xcache image rotate

Postby alamata on Fri Apr 25, 2008 10:23 am

S Pittaway wrote:the cache stuff was really for my use i just left it there in case... :)


personnaly i find this freature very interresting... :wink:
even with the wasting of memory on the disk...


i would like create an reflection effect with the category music...
with a particular effect of oriented display

so,i believe i need probably function of xcache image rotate

i have tried several combination
but i dont remember all of this... :oops:

but per example with
where 1 is a nane of category

xdatabase xcache update 1 true

i find a folder in the cache files folder
of xdatabase folder called 1 but it s empty

i supose i need more informations to specifiy in the ini file
but i can put it into correctly...

and i dont know what is the instruction
to make appears the generated ratated image on a screen

ps: is it possible to put more value for the rotation more that 90,180,270
is it possible to display a all category with the new possibility for orientation
like this for the text ""category>music>1>0,35"

thanks for your comprehension
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: how to display a xcache image rotate

Postby S Pittaway on Mon Apr 28, 2008 7:46 am

ah i see.

The plugin wont do reflections i was simply saying it would be nice if it did :) i will probably add it at some point (or someone else can??).

The rotation option is just for fixing photo's - it lets you rotate them left/right.

The angled display stuff is done in xlobby using a text box like "category>movie>cover>offset>angle" so it might look like "category>movie>cover>2>0.15"
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how to display a xcache image rotate

Postby defrag on Mon Apr 28, 2008 9:30 am

I looked at doing a reflection plugin, not easy as you either have to intercept the images before they are rendered (which is what you currently do) or you try and take a copy of the button area that contains the image(s), which you can get at runtime, and create a new area that has a reflection of the captured area - the downside with this solution is that you need to have a solid background. And if you are doing this with categories - catching when areas are selected or paged so you can redraw - not nice.....

I like the approach you took to merge the images, so I could attempt to build it on top of that.... if I can remove the shackles work have me in!! :D
defrag
 
Posts: 376
Joined: Mon Jan 16, 2006 7:56 am
Location: Didcot, UK

Re: how to display a xcache image rotate

Postby alamata on Mon Apr 28, 2008 12:51 pm

first thanks for your answer... :)

S Pittaway wrote:The plugin wont do reflections i was simply saying it would be nice if it did :) ...


sorry... but i have like habit that xlobby make my dream of skinning come true... ;)

S Pittaway wrote:...The angled display stuff is done in xlobby using a text box like "category>movie>cover>offset>angle" so it might look like "category>movie>cover>2>0.15"...


i suppose that at this time there are no possibilities to make an angled display with "a all category"
it is "only" possibile to make that actually with a text box...
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: how to display a xcache image rotate

Postby CiXel on Mon Apr 28, 2008 7:35 pm

alamata wrote:first thanks for your answer... :)

S Pittaway wrote:The plugin wont do reflections i was simply saying it would be nice if it did :) ...


sorry... but i have like habit that xlobby make my dream of skinning come true... ;)

Making a reflection is not actually that hard. You can place a transparent gradient overlay over the rotated image. Viola!
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Re: how to display a xcache image rotate

Postby S Pittaway on Tue Apr 29, 2008 8:38 am

its more complicated than that... i had a play list night

You cant simply use a LinearGradientBrush and then paint it transparent... if you do you have to specify a background colour so its not like a proper reflection.

Is that what you mean? This is the obvious code to try go give the reflection bit -

Code: Select all
        // Draw the main image to oGraphic

        // Copy the bottom of the main image to RGraphic / RImage

        //Now flip it
        RImage.RotateFlip(RotateFlipType.RotateNoneFlipY);

        // Finish the reflection using a gradiend brush
        LinearGradientBrush brush = new LinearGradientBrush(PictureRectangle, Color.FromArgb(200, Color.Black), Color.FromArgb(255, Color.Black), 90, false);
        RGraphic.FillRectangle(brush, PictureRectangle);

        //Draw the reflection on the main image
        SrcRectangle = new Rectangle(0, 0, RImage.Width, RImage.Height);
        PictureRectangle = new Rectangle(0, Height, Width, RHeight);
        oGraphic.DrawImage(RImage, PictureRectangle, SrcRectangle, GraphicsUnit.Pixel);



It looks great on a "solid" background -
2.jpg


But looks rubish if you want to "overlay" it -
3.jpg




Via the god of google the best i could come up with was this which is as clunky as hell! -

Code: Select all
        // Draw the main image to oGraphic

        // Copy the bottom of the main image to RGraphic / RImage

        //Now flip it
        RImage.RotateFlip(RotateFlipType.RotateNoneFlipY);

        // Color Matrix for transparency
        int RefGap = 0;
        ColorMatrix cm = new ColorMatrix();
        ImageAttributes ia = new ImageAttributes();

        // Set each row of pixels to be more and more transparent
        for (int c = 0; c < RHeight; c++)
        {
          // Increase the transparency
          cm.Matrix33 = (0.9F - 0.9F*((float)c / RHeight)) * (float)Reflectivity;
          ia.SetColorMatrix(cm);

          //  Rectangle dims
          int x = 0;
          int y = Height + RefGap + c;
          int h = 1;
          int w = Width;

          //Copy this row and set it transparent...
          oGraphic.DrawImage(RImage, new Rectangle(x, y, w, h), x, (c + 1), w, h, GraphicsUnit.Pixel, ia);
        }


Like i said this is clunky but does work -
1.jpg



Does anyone have a better way of doing the reflection?
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how to display a xcache image rotate

Postby alamata on Sun May 04, 2008 10:33 pm

Great... :)

it s seems a very good thing...

but

:arrow:

how is the way to implement this for a new skin...

sorry for the delay....
and
thanks for your comprehension...
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: how to display a xcache image rotate

Postby alamata on Fri Jun 06, 2008 12:04 pm

Great work :!: :!:

thanks a lot to have implement this freature

into

:arrow: xdatabase :!:
alamata
 
Posts: 70
Joined: Thu Jan 11, 2007 12:03 pm

Re: how to display a xcache image rotate

Postby Rusty on Wed Jul 02, 2008 4:21 pm

Hello S Pittaway. I am new to xlobby. It looks like you have a source code there. Where do I put that code and is there anything else I would need to do?

Thanks.
Rusty
 
Posts: 6
Joined: Wed Jul 02, 2008 2:46 pm

Re: how to display a xcache image rotate

Postby S Pittaway on Thu Jul 03, 2008 11:40 am

I added it into my plugin xDatabase - http://www.xlobby.com/forum/viewtopic.php?f=14&t=6292

I am busy at the moment, but feal free to have a play :)

Remember that this is NOT done on the fly, instead it creates a local copy of the cverart which has reflections added...

Having said that it does work and i use it in my current skin -

Image1.jpg


Image2.jpg
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England

Re: how to display a xcache image rotate

Postby S Pittaway on Thu Jul 03, 2008 11:41 am

You cant really see the reflectiosn there but they are :)
S Pittaway
 
Posts: 651
Joined: Wed Jan 25, 2006 11:08 am
Location: Manchester, England