473,657 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Apply texture on text?

Hello

I was wondering if you guys know how i can apply a picture as texture on
text?

I have this:

Font font = new Font("Verdana", 18);

SolidBrush sb = new SolidBrush(Colo r.Red);

Bitmap tb = new Bitmap(200,60);

Graphics bmpGraphics = Graphics.FromIm age(tb);
font.GetHeight

bmpGraphics.Cle ar(Color.White) ;

bmpGraphics.Dra wString("Lasse" , font, sb, 14, 10);

tb.Save(@"c:\in etpub\wwwroot\d btest\text.jpg" , ImageFormat.Jpe g);
Nov 16 '05 #1
3 1698
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile( "n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i) ;
Graphics.DrawSt ring("HELLO WORLD", new Font("Arial", 30), b, 50, 50);

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Morten,

thanks, but when I write

Image i = new Image. I only get "GetThumbnailIm ageAbort" shown in that
droplist.

i've got:

using System;
using System.Drawing;
using System.Drawing. Drawing2D;
using System.Drawing. Imaging;

have i forgot something?

TIA
/Lasse

Morten Wennevik" <Mo************ @hotmail.com> wrote in message
news:opse219ktt klbvpo@stone...
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile( "n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i) ;
Graphics.DrawSt ring("HELLO WORLD", new Font("Arial", 30), b, 50, 50);

--
Happy coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #3
errr...... never mind :D

thx for helping :)

/Lasse
"Morten Wennevik" <Mo************ @hotmail.com> wrote in message
news:opse219ktt klbvpo@stone...
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile( "n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i) ;
Graphics.DrawSt ring("HELLO WORLD", new Font("Arial", 30), b, 50, 50);

--
Happy coding!
Morten Wennevik [C# MVP]

Nov 16 '05 #4

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

Similar topics

1
5025
by: Mark L | last post by:
I am trying to create a graphics engine using OpenGL and PHP. I am currently trying to create a completly white texture to test out the texturing capabilities. My idea is to create an array 256x256x3 of the value 255 to create a completely white texture. When I do this in C it works fine but in PHP I get a array of red, blue, green and black lines texturing the cube. I have built a webpage detailing this problem:...
3
1706
by: Xpyder | last post by:
hey - i am developing a game editor in C++/DX and have encountered a problem. when i create map sturcture array (like below) to represent tile textures: o,1,o, 1,1,o, 1,1,1, 1,1,o,
1
3212
by: Myk Quayce | last post by:
I have a four-sided polygon that rotates and zooms as the user moves the mouse. Is there a way to incorporate a texture-mapped image without DirectX? The GDI+ doesn't seem to support this. -- Myk Quayce "If we can't be free, at least we can be cheap." - Frank Zappa
0
4370
by: Kuba Florczyk | last post by:
Hi I'am working on a 3D realtime "video" mixer. For now everything is ok i made video/images/sound mixing in 3D space. But now i draw flash movie on a texture. My question is: how do it? I've got two options: - write directshow filter for SWF files (maybe somebody saw something like
3
1386
by: x | last post by:
Still fairly new at this, I have been trying to find out how to compile and effect with multiple samplers. Been able to find loads of examples that show the HSL code once the samplers are loaded, but not how to get the textures from VB into the shader. If i set up two samplers in the shader with no associated texture then when I compile the shader from string works fine. but when the shader actually runs both sample the same texture...
2
1673
by: =?ISO-8859-2?Q?Rafa=B3?= Maj | last post by:
Say we have a class Model (a 3d model) and class Texture (representing an Texture). Model have a texture, Model can be Drawed. Texture have method that returns data needed for drawing. class Texture { public: // openGl data here glInt GetInt();
0
1458
by: ...:::JA:::... | last post by:
Hello, Is there any real easy example for loading an texture in your directpython window??? For example this is my code: # loading directpython modules import d3dx import d3d from d3dc import *
7
2095
by: colin | last post by:
Hi, Ive written a 3dmodel editor, and it works fairly well it harldy uses any cpu exept when its loading a texture from bitmap in the debugger, at all other times it hardly uses any cpu but from the debugger even in release mode it takes a second or so to load a 65k texture, with a 2ghz pc this is 10k instructions per pixel ! I cant understand what its doing here, can anyone shed any light on this ? I have the d3d debug turned off...
0
1554
by: brixton | last post by:
Hello, I've got the following code that creates a texture from a .RAW file: GLuint MyGLCanvas::LoadTextureRAW( const char * filename, int wrap ) { GLuint texture; int width, height; BYTE * data; FILE * file;
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.