Graphics.DrawString

How i draw in Vertical

use the STRINGSHAPE object (look in the LR under OBJECT2D)

Dim s as New StringShape
s.Text = "Hello World"
s.TextFont = "Helvetica"
s.Bold = True
s.Rotation = 3.14159/2  // (radians, 90 degrees = pi/2)
s.Y = 100
g.DrawObject(s)

Hi Dave
i am Tray to use J4LBarcode1D and draw String vertical to use Dymo LabelWriter 400 printer and is so hard for my i am no good at graphics .

or look open source Bar code that i can do this
i do not now about canvas works

Google led me here: http://www.java4less.com/barcodesrealbasic/barcodesrealstudio.php?info=userguide
where I saw paintBarcode(g as Graphics):

So couldn’t you just rotate the graphics object after you paint it, before you print it?

i the bar code is rotate but i need to add some description like Price ,date before print

  • i need to rotate vertical

as it is for me to make a puzzle

this is my second week working with this Barcode

i going to try Cristian Lib to see it if works

i am try to make some ting like this
http://www.shutterstock.com/pic-102633986/stock-vector-set-of-price-and-barcode-sticker.html

If you can Dave
i Dave if you send me you email i send you the small projects so you can help me what i am doing wrong.

i am litter lost

[quote=89677:@Alexis Colon Lugo]If you can Dave
i Dave if you send me you email i send you the small projects so you can help me what i am doing wrong.

i am litter lost[/quote]
Alexis,

Try to get your thoughts organized and send fewer messages with more content. :slight_smile:

You’re being offered two options:

Dave explains how to draw rotated text directly (by using a stringshape, which is a drawing object)
Tim explains that you could draw text and then rotate that drawing.

Think of your image as a group of separate pieces, like Lego, that you have to build. Your barcode is just one of these pieces. It’s probably irrelevant to what you want to do since from that you get a picture you insert into your template.

Take a deep breath, organize your thoughts and share your code. If I were you I’d set it up so you should have a main method for building the final graphic, and that in turn calls a method for getting the barcode, a method for getting the price and a method for getting the “adornments” (like the red tab in your example).

So you’d feed your main method the code, price and tag (“PRICE”, “SALE”) and then you build your ticket calling other subroutines

this is on canvas paint (i need to add all this in one Canvas Obj)

code=“12345”

barcode.barBackColor=self.barBackColor
barcode.code=self.code
barcode.barFontName=self.barFontName
barcode.barFontSize=self.barFontSize
barcode.barForeColor=self.barForeColor
barcode.barHeight=50
barcode.barType=self.barType
barcode.checkCharacter=self.checkCharacter
barcode.Code128Set=self.Code128Set
barcode.H=10
barcode.leftMargin=self.leftMargin
barcode.N=self.N
barcode.textOnTop=self.textOnTop
barcode.topMargin=self.topMargin
barcode.X=self.X
barcode.I=self.I
barcode.UPCEANSupplement2=self.UPCEANSupplement2
barcode.UPCEANSupplement5=self.UPCEANSupplement5
barcode.supplement=self.supplement
barcode.UPCESystem=self.UPCESystem

barcode.width=self.width
barcode.height=self.height

barcode.paintBarcode(g)

//creates new picture
dim pic as new Picture(width, height, 32)

barcode.paintbarcode(pic.Graphics)

Dim s as New StringShape
s.Text = “Hello World”
s.TextFont = “Helvetica”
s.Bold = True
s.Rotation =3.14159/2 // (radians, 90 degrees = pi/2)
s.Y = 100
s.x=8
g.DrawObject(s)

dim min as integer

min=height
if (min>width) then min=width

dim newpic as new Picture(width,height, 32)
dim surf0 as RGBSurface = pic.RGBSurface
dim surf1 as RGBSurface = newpic.RGBSurface
dim x, y as Integer

for y = 0 to height - 1
for x = 0 to width - 1
surf1.Pixel(y, min - x) = surf0.Pixel(x, y)

next x

next y

g.DrawPicture(newpic,0,0)

And? did it work? if not what incorrect results did you get?
Please show that you at least have the initiative to attempt to help yourself, and then failing that to help us help you.
key word here is help… not do it for you. I

it works but when i rotate the Bar Code the draw String disappears i do not now what is the problems.

I can not find draw string it go after rotate the bar code

sorry for late reply was in the lab making a blood evidence I have heart disease

thanks

Hi i have some progress

how i now a Report Picture Box size is 1"X 3.5" inches (Vertical)
so what is the equivalent size in canvas in vertical so i can make visual my Bar Code and info and the print

I think that you might be miscalculating the rotated position of the stringShape. You may need to set the alignment… Not sure, but might be something to look at I believe the x,y are the origin of the rotation.Better to use eg. DrawObject(s,8,100). I’ve never gotten a stringshape to rotate to where I want it first try. Try rotating it a few degrees and then a few more to get an idea of why it is disappearing.

(also, try the code button in the reply box here… it’ll save us from having to decode =3 )

how i copy the draw text from one canvas and and to the other canvas in a specific position

dim pic as new Picture(width, height, 32)

Dim s as New StringShape
s.Text = “Hello World”
s.TextFont = “Helvetica”
s.Bold = True
s.Rotation =-3.14 /2
s.Y = 100
s.x=15
g.DrawObject(s)

code=“12345”

barcode.barBackColor=self.barBackColor
barcode.code=self.code
barcode.barFontName=self.barFontName
barcode.barFontSize=self.barFontSize
barcode.barForeColor=self.barForeColor
barcode.barHeight=50
barcode.barType=self.barType
barcode.checkCharacter=self.checkCharacter
barcode.Code128Set=self.Code128Set
barcode.H=10
barcode.leftMargin=self.leftMargin
barcode.N=self.N
barcode.textOnTop=self.textOnTop
barcode.topMargin=self.topMargin
barcode.X=self.X
barcode.I=self.I
barcode.UPCEANSupplement2=self.UPCEANSupplement2
barcode.UPCEANSupplement5=self.UPCEANSupplement5
barcode.supplement=self.supplement
barcode.UPCESystem=self.UPCESystem

barcode.width=self.width
barcode.height=self.height

barcode.paintBarcode(g)

barcode.paintbarcode(pic.Graphics)

dim min as integer

min=height
if (min>width) then min=width

dim newpic as new Picture(width,height, 32)
dim surf0 as RGBSurface = pic.RGBSurface
dim surf1 as RGBSurface = newpic.RGBSurface
dim x, y as Integer

for y = 0 to height - 1
for x = 0 to width - 1
surf1.Pixel(y, min - x) = surf0.Pixel(x, y)
next x
next y

g.DrawPicture(newpic,0,0)

i try to use two canvas to make one and the print my label how i can do this

Alexis… I realize that English is not your primary langauge… but if you want help, I suggest you take some time and write a detailed description of what you want to do, what you have tried, what has failed (and why you think it failed). Take the time to translate it so those of us who only speak English can better help you. Throwing one line “statements” like you did above is totally useless, and unless someone here is interested or intrigued by your problem (which is difficult with the tiny amount of information), then the amount of help you will recieve will be just as small.

Perhaps a picture of what you want to create?

Forgive me for writing something personal but thanks for all you time to help me

I’m trying to make canvas that contains a barcode with numbers and description and then move it to the Report Writer but i have to rotate Vertical the canvas to fit in 1"x3" label.

Example: this have to rotate Vertical for the type on label and printer

  Price $23.00

|||||||||||||||
12345