472,353 Members | 1,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

rotate bmp (Xlib)

I must rotate bmp using Xlib without change bmp's memory. If someone
knows how I can do this, please help me.
dariusz
sorry about my english, I'm still learning
Jan 17 '08 #1
2 3192
Da****************@gmail.com writes:
I must rotate bmp using Xlib without change bmp's memory. If someone
knows how I can do this, please help me.
Perhaps you should ask about this in a newsgroup related to Xlib.
You are more likely to get correct responses if you ask there.
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa6 7f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}}
Jan 17 '08 #2
<Da****************@gmail.comwrote in
>
I must rotate bmp using Xlib without change bmp's memory. If someone
knows how I can do this, please help me.
Load the bmp into memory.
I recently posted functions to do this.

Then apply the formula

ax = x - centralx;
ay = y - centraly;

(assuming you wnat to rotate about the centre)

theta is the angle to rotate by

bx = ax * cos(theta) - ay * sin(theta);
by = ax * sin(theta) + ay * cos(theta);

x = bx + centralx;
y = by + centraly;

Work from destination to source, or you will get missing pixel in the
destination image.
(For a very high quality rotate you need to do anti-alising as well).

Then you simply use Xlib to display the new image you have constructed. I'm
pretty sure it has no built-in rotate functions itself.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm
Jan 17 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Artificial Life | last post by:
All I really want is to write a few strings to the background of my X display. XDrawString() is what I need. The Xlib for Python shows it's out...
3
by: byrd48 | last post by:
Hi, I am developing a web site which allows users to upload and share photos. I have a datalist which lists the photos and has the usual edit,...
0
by: Ferry Boender | last post by:
Hi, I'm relatively new to Xlib programming, and I ran into a little problem. I'm trying to insert keypress events into a X window. The...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
8
by: lovecreatesbeauty | last post by:
I write a function to rotate a matrix by 90 degrees clockwise, this function works on a matrix of specific size, for example, it rotates a 4*4...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
10
by: Joey_Stacks | last post by:
Does anyone know of a scipt that will rotate random div layers on page refresh? I have a primary content area front and center on my site...
0
by: jubi | last post by:
I'm searching an algorithm to rotate a X11 pixmap (in C with xlib). I'm drawing on a tk canvas (which is implemented as a X11 Pixmap) and want to...
1
by: giovanni.iovino | last post by:
Hi, sorry for my English. I'm writing my first python script for Linux for a remote bluetooth application. I'm using python-xlib library to send...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.