473,503 Members | 2,049 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(Color.Red);

Bitmap tb = new Bitmap(200,60);

Graphics bmpGraphics = Graphics.FromImage(tb);
font.GetHeight

bmpGraphics.Clear(Color.White);

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

tb.Save(@"c:\inetpub\wwwroot\dbtest\text.jpg", ImageFormat.Jpeg);
Nov 16 '05 #1
3 1692
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile("n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i);
Graphics.DrawString("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 "GetThumbnailImageAbort" 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:opse219kttklbvpo@stone...
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile("n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i);
Graphics.DrawString("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:opse219kttklbvpo@stone...
Hi Lasse,

You can use a TextureBrush

Image i = Image.FromFile("n:\\open-gate.jpg");
TextureBrush b = new TextureBrush(i);
Graphics.DrawString("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
5011
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...
3
1690
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
3197
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. -- ...
0
4364
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? ...
3
1373
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...
2
1655
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...
0
1446
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...
7
2087
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...
0
1540
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; ...
0
7091
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...
1
6998
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...
0
7464
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...
1
5018
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...
0
4680
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...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1516
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
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...

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.