473,569 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3359
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);in t main(void){unsi gned long b[]
={0x67dffdff,0x 9aa9aa6a,0xa77f fda9,0x7da6aa6a ,0xa67f6aaa,0xa a9aa9f6,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)bre ak;else default:continu e;if(0)case 1:putchar(a[i&15]);break;}}}
Jan 17 '08 #2
<Da************ ****@gmail.comw rote 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
1966
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 dated. Is there any alternative?
3
2546
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, update commands. Within the edititemtemplate, I have links to allow the user to rotate the photo 90 degrees left or right. After I rebind the datalist,the photo is not rotated on the web page,...
0
1891
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 following code works: --8<------------------------------------------------------------ #!/usr/bin/python
17
29383
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
11011
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 matrix of integers in the following code. The function makes one more copy of the original matrix, how is the efficiency? Can the copy be saved? Comments on it are welcome. Can I extend it to work on...
8
16793
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
10
10917
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 homepage, and I'd like to rotate various chunks of html (in div layers) each time a user reloads the page. Right now I'm resorting to a random image rotation (those scripts are a dime a dozen) on refresh,...
0
1495
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 rotate all elements i have drawn on it (it's a city map).
1
4071
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 keyboard and mouse events and at the moment I can send keyboard emulated input to the window where pointer is on, i can also move the pointer over the desktop. I'm using python 2.5 on a Ubuntu...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.