LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-25-2003, 10:30 PM   #1
Fe98
Member
 
Registered: Sep 2003
Distribution: RH9
Posts: 49

Rep: Reputation: 15
Zooming (C++)


Hi guys, need some advice here. I need to display some text on the screen (code actually).
However I need to add support for zooming. For example, I want to be able to zoom in on a particular area, and similarly to zoom out so that I can see all/most of the code at once.

The code will be colour-coded (hmmm) so let's say that some lines will be black and others, red.

One method I was thinking of was when zooming out, simply draw a line on the screen representing a line of code (either black or red). Then by clicking on it I can zoom in. Would this work? Can you all give me a better/alternative approach?
 
Old 11-26-2003, 07:24 AM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
render the code to large bitmap, then scale the bitmap to the appropriate size and draw. i have no X11 programming experience but i could knock up a win32 example if it would help.
 
Old 11-26-2003, 10:46 PM   #3
Fe98
Member
 
Registered: Sep 2003
Distribution: RH9
Posts: 49

Original Poster
Rep: Reputation: 15
Not sure if you misunderstood me (or maybe I misunderstood you), it is text that I want to zoom, not a picture.
 
Old 11-26-2003, 11:41 PM   #4
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I suppose you'd need to find a way to display text in a different size; I have no idea how you could do that without using graphics Usually the console font is fixed according to the VGA mode you're running in; fonts in a terminal window cannot, as far as I know, be manipulated by a programming running in the terminal window.

You could do it with ASCII art, I guess

ZOOM

Code:
ZZZZ  OO   OO  M   M
  Z  O  O O  O MMMMM
 Z   O  O O  O M M M
ZZZZ  OO   OO  M M M
 
Old 11-27-2003, 09:45 AM   #5
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
i assumned you wanted to do this in X, so as i said all you would need to do was render the text to a bitmap then scale appropriatly and draw. but if your trying to do it in a console then ive no idea how to do it, as wapcaplet said i dont think its possible without using graphics.

just had an idea for doing it on console - do as i say above render the text to a bitmap, scale it, then draw it with aalib. results wont look amazing but i think theyed be pretty good.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
9.3 - No more Icon Zooming? NCAussie SUSE / openSUSE 2 07-23-2005 11:22 AM
KDE 3.4 Icon Zooming AngryLlama Linux - Software 7 06-17-2005 03:02 AM
KDE icon zooming nirvanix Linux - General 0 06-29-2004 11:13 AM
no auto zooming alexchannell Linux - Software 0 12-09-2003 03:44 PM
icon zooming does not work dave13 Linux - General 1 10-14-2003 06:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration