magicbox

所属分类:OpenGL
开发工具:C#
文件大小:1117KB
下载次数:131
上传日期:2008-03-15 10:09:15
上 传 者zodiactrone
说明:  使用Win32 API 和 OpenGL 编写的3D图形界面演示程序,很美观。
(Use Win32 API and the OpenGL graphics interface to prepare the 3D demo program, it is beautiful.)

文件列表:
MagicBox (0, 2006-11-20)
MagicBox.sln (913, 2006-11-09)
MagicBox.suo (33792, 2006-11-20)
MagicBox\bin (0, 2006-11-11)
MagicBox\bin\Debug (0, 2006-11-20)
MagicBox\bin\Debug\cogs2.jpg (363107, 2006-03-23)
MagicBox\bin\Debug\gdimage.dll (68096, 2006-10-27)
MagicBox\bin\Debug\MagicBox.exe (352256, 2006-11-20)
MagicBox\bin\Release (0, 2006-11-11)
MagicBox\DDWcontrol.cs (3388, 2006-11-12)
MagicBox\DDWcontrol.Designer.cs (1607, 2006-11-12)
MagicBox\DDWcontrol.resx (5814, 2006-11-12)
MagicBox\GDImage.cs (23806, 2006-11-12)
MagicBox\MagicBox.csproj (7647, 2006-11-20)
MagicBox\MagicBox.csproj.user (538, 2006-10-09)
MagicBox\MAIN_Form.cs (33819, 2006-11-20)
MagicBox\MAIN_Form.Designer.cs (54442, 2006-11-20)
MagicBox\MAIN_Form.resx (288146, 2006-11-20)
MagicBox\MsgBox_About.cs (6106, 2006-11-12)
MagicBox\MsgBox_About.Designer.cs (25128, 2006-11-11)
MagicBox\MsgBox_About.resx (9923, 2006-11-11)
MagicBox\obj (0, 2006-11-19)
MagicBox\obj\Debug (0, 2006-11-20)
MagicBox\obj\Debug\MagicBox.csproj.GenerateResource.Cache (2414, 2006-11-20)
MagicBox\obj\Debug\MagicBox.DDWcontrol.resources (180, 2006-11-19)
MagicBox\obj\Debug\MagicBox.exe (352256, 2006-11-20)
MagicBox\obj\Debug\MagicBox.MAIN_Form.resources (190065, 2006-11-20)
MagicBox\obj\Debug\MagicBox.MsgBox_About.resources (2996, 2006-11-19)
MagicBox\obj\Debug\MagicBox.pdb (136704, 2006-11-20)
MagicBox\obj\Debug\MagicBox.Properties.Resources.resources (69468, 2006-11-20)
MagicBox\obj\Debug\MagicBox.SkinButton.resources (180, 2006-11-19)
MagicBox\obj\Debug\MagicBox.SkinCaption.resources (180, 2006-11-19)
MagicBox\obj\Debug\MagicBox.TRACK_Back.resources (180, 2006-11-19)
MagicBox\obj\Debug\TempPE (0, 2006-11-20)
MagicBox\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll (8192, 2006-11-20)
MagicBox\obj\MagicBox.csproj.FileList.txt (487, 2006-11-20)
MagicBox\OpenGL.cs (12509, 2006-11-11)
MagicBox\Program.cs (2926, 2006-11-12)
MagicBox\Properties (0, 2006-11-20)
MagicBox\Properties\AssemblyInfo.cs (1352, 2006-09-27)
... ...

MagicBox Ce projet utilise uniquement les possibilités de VISUAL C# 2005 Express Edition, il nécessite une carte graphique compatible OpenGL. La démo montre l'utilisation d'images de différents format avec un contrle OpenGL couplé à une fenêtre SDI skinnée. Toutes les fenêtres sont skinnées, y compris la messagebox, afin de montrer l'utilisation du grisage de fenêtre DDW (Drawing Disabled Window). L'image active est affichée dans un système 3D utilisant des coordonnées polaires. Elle peut être manipulé à la fois avec les boutons de direction pour changer l'angle de rotation ou directement avec le bouton gauche de la souris dans la fenêtre OpenGL. A noter que les boutons de direction peuvent être cliqués plusieurs fois pour augmenter la vitesse de rotation. Le projet utilise différentes classes ainsi que des "contrles utilisateur" afin de skinner l'application. Le contrle GDImage/OpenGL est subclassé pour permettre l'utisation de la souris et le "smooth zooming". Contenu du projet: - SkinEngine.cs Cette classe prend en charge la charte graphique utilisée pour skinner la fenêtre SDI principale et la messagebox. - SkinCaption.cs Contrle utilisateur utilisé pour afficher le titre de la fenêtre skinnée. Il permet le déplacement de la fenêtre au dessus du bureau Windows. Il a les mêmes possibilité de paramétrage qu'un bouton VS (image de fond, position du texte, couleur, fonte, etc.) - SkinButton.cs Contrle utilisateur utilisé pour créer des boutons skinnés en mode 5-image dont chacun des 5 états correspond respectivement à : normal, enfoncé, désactivé, focus, survolé. Vous pouvez utiliser indifféremment un bouton de forme rectangulaire "standard" ou un bouton de n'importe quel forme avec région. - SkinTrackbar.cs Contrle utilisateur utilisé pour créer un "trackbar" skinné. Le curseur peut avoir n'importe quel taille et forme car il est basé sur un bitmap (image de fond). L'orientation du contrle est déterminée par rapport à la largeur et la hauteur, si la largeur est plus grande que la hauteur, l'orientation est horizontale, sinon verticale. Afin d'indiquer à l'utilisateur le sens du déplacement, un triangle est dessiné sur le fond et un tooltip affiche la valeur actuelle au survol du curseur. On peut inverser le sens du déplacement en inversant les bornes min/max. - DDWcontrol.cs Contrle utilisateur utilisé pour assombrir la fenêtre mêre, lors de l'ouverture d'une fenêtre popup fille modale. - OpenGL.cs Encapsulation de l'API OpenGL. - Win32.cs Encapsulation de l'API Win32. - GDImage.cs Encapsulation de l'API GDImage. GDImage est requis pour créer la fonte OpenGL et convertir l'image selectionnée en texture BGR 32-bit à la volée. Ce projet représente un certain tavail (ou devrais-je dire un "travail certain"), il contient certains concepts exclusifs que j'ai peaufiné au cours des années, j'espère qu'il vous plaira. Vous trouverez toutes mes démos actualisées sur www.zapsolution.com à partir du lien "C# corner" ////////////////////////// Basename: magicbox Article Title: Magic Box Description: OpenGL + skinEngine. Keywords: OpenGL, Skin, Subclassing, User control. Download source files - 996 Kb Introduction The project uses exclusively the features found in VISUAL C# 2005 Express Edition. The purpose of the demo is to display different graphic image format in an OpenGL control, inside of a skinned form. Both the main form and its child popup message box are skinned, showing you how to use DDW (Drawing Disabled Window) when the child pops up over the main window. The selected image is shown in 3D polar coordinates using either the left mouse button and/or buttons to change its rotation angle. The project uses several classes and "user controls" to help skinning of the form. The control itself is subclassed to perform mousing and smooth zooming. Code insight: - SkinEngine.cs This class is responsible for the drawing of SDI skinned form (either main and/or child popup). - SkinCaption.cs User control to be used for the text caption of a skinned form. It allows moving the form hover the desktop. It has the same scope of properties than a VS button. - SkinButton.cs User control to create skinned button using one single 5-image bitmap matching each of the button state: normal, down, disabled, focused, hover. You can use either "standard" push button or shaped button with region. - SkinTrackbar.cs User control to create a mouse only skinned track bar. The thumb tracker can have any size or shape based on a provided bitmap. The control orientation is based on the ratio between width and height, if width is larger than height then horizontal else vertical. To help the user to figure the moving of the thumb track, the control draws a layered triangle hover the background and uses a tooltip to show the current value. You can inverse ranging swapping min/max values. - DDWcontrol.cs User control to darken the main form while displaying a modal child popup waiting for user input. - OpenGL.cs Encapsulation of the OpenGL API being used. - Win32.cs Encapsulation of the Win32 API being used. - GDImage.cs Encapsulation of the GDImage API being used. GDImage is a prerequisite to create OpenGL font and convert image to GL texture on the fly. Comment: This project embeds several technics that took me years to "peaufine", I hope you will like it and perhaps learn a few things from it. You will find more contributions on my web site www.zapsolution.com in the "C# corner" section.

近期下载者

相关文件


收藏者